[2..5]*2 -> cartesian.map_2d {|a,b| a**b }.sort.uniq.say
Alternative solution:
2..5 ~X** 2..5 -> sort.uniq.say
[4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125]
Last updated 3 years ago