Skip to content

Instantly share code, notes, and snippets.

@hamakn
Created October 6, 2015 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamakn/2893cd44c8e029e0c66b to your computer and use it in GitHub Desktop.
Save hamakn/2893cd44c8e029e0c66b to your computer and use it in GitHub Desktop.
['+', '-', ''].repeated_permutation(8).each do |p|
arr = []
(1..9).each do |i|
arr << i
arr << p.shift
end
str = arr.join
ans = eval(str)
p str if ans == 100
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment