Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
awaage
· 15y ago · 0 comments
how about this (example in ruby): def plus_1(x); arr = []; arr[x] = true; return arr.size; end
Comments
[–]
kirillzubovsky
15y ago
Funny, this is the first thing I thought of, but then realized it would only work if x>0
[–]
awaage
OP
15y ago
oops! good catch!
[–]
custominstall
15y ago
lol .. but also wont work for decimals