From: "Hyun Oh K." Date: 2013-04-15T21:53:13+09:00 Subject: Re: simple lambda question OMG! this is the simplest way! Thank you! Very simple... beautiful! Robert Klemme wrote in post #1105671: > On Mon, Apr 15, 2013 at 6:29 AM, Lee Daekeun wrote: > >> Like this? >> >> 100.times.select{|a| a*a>1000}.map{|a| [a, (a*a).to_s]}.select{|a| >> a[1][0]==a[1][1] and a[1][2]==a[1][3]} >> > > Or > > irb(main):007:0> 100.times {|a| s = (a * a).to_s; puts a, s if > /\A(\d)\1(\d)\2/ =~ s} > 88 > 7744 > => 100 > > Cheers > > robert -- Posted via http://www.ruby-forum.com/.