I am trying to return a list/array of values from a range of (100..1000) that match the following criteria:
- 3 digit value
- All the digits in each value are unique.
$global_range = Array (100..999)
$fun = []
def listOfFunPossibilities
# FUN values should meet the criteria below:
# 1. 3 digit value
# 2. All are unique
$global_range.each do |i|
if (!(/([0-9]).*?\1/)).match?(i)
$fun.push(i)
end
end
return $fun
end
listOfFunPossibilities()