> 알고리즘 문제 풀이/프로그래머스
lv1-x만큼 간격이 있는 n개의 숫자 (python, 파이썬)
bky373
2020. 10. 22. 11:44
""" 1번: 나의 풀이(map 사용) """
def solution(x, n):
tmp = [i+1 for i in range(n)]
return list(map(lambda t: t*x, tmp))
""" 2번: 다른 사람의 풀이 """
def solution2(x, n):
return [x*(i+1) for i in range(n)]