3 ms·
how about this (example in ruby): def plus_1(x); arr = []; arr[x] = true; return arr.size; end
by awaage 15y ago
how about this (example in ruby):
def plus_1(x); arr = []; arr[x] = true; return arr.size; end
- kirillzubovsky 15y agoFunny, this is the first thing I thought of, but then realized it would only work if x>0
- awaage 15y agooops! good catch!
- custominstall 15y agolol .. but also wont work for decimals