728x90
반응형

Computer science/알고리즘

[자바스크립트로 구현한 알고리즘] Count by X

Create a function with two arguments that will return a list of length (n) with multiples of (x). Assume both the given number and the number of times to count will be positive numbers greater than 0.Return the results as an array (or list in Python, Haskell or Elixir). Examples: countBy(1,10) === [1,2,3,4,5,6,7,8,9,10] countBy(2,5) === [2,4,6,8,10] 이런 방법으로 첫 코딩을 작성했다. 좀 더 보기 좋은 코드로는 이렇게 작성도 가능하다.

2016.09.12 게시됨

728x90
반응형