Created
October 27, 2014 17:31
-
-
Save mizchi/5076493ed27add299ade to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 問題: 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2, 1, 3, ... | |
# という数列のn番目の数字を求める関数を書け | |
f = (n) -> n + 5 | |
solve = (index)-> | |
ret = "" | |
while true | |
ret += f(cnt++) | |
if ret.length > index | |
return ret[index] | |
console.log 'answer', solve(7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment