Your submitted solution works for me, inside codewars, and with ruby 1.8/1.9/2.0/2.1/jruby. I have no idea what the problem is.
However, the code snippet you posted is returning words in a different order than found in the dictionary. Your submitted solution fixes that (with a hack ;).
Using it and works like a charm... What was it that frustrated you?
Already submitted the random test cases. Waiting for author's answer.
Isn't 1 a power of 2 ?
2 ** 0 = 1 ?
Isn't 1 a power of 2 ?
2**0 = 1 ?
Your submitted solution works for me, inside codewars, and with ruby 1.8/1.9/2.0/2.1/jruby. I have no idea what the problem is.
However, the code snippet you posted is returning words in a different order than found in the dictionary. Your submitted solution fixes that (with a hack ;).