On Sat, Jun 1, 2013 at 9:51 AM,  <sto.mar / web.de> wrote:
> Am 01.06.2013 15:21, schrieb Harry Kakueki:
>
>>
>> def try2(n)
>>    s, q = n.to_s.size, n*n
>>    (s...s*2).each do|x|
>>      y = 10**x
>>      return true if n == q/y+q%y
>>    end
>>    false
>> end
>
>
> OP was asking for "eloquent" solutions...



This may not be eloquent ruby, but it certainly is sublime. Only patch
would be to test if n is a non-negative Integer.