Skip to content

Instantly share code, notes, and snippets.

@andrewytliu
Created December 4, 2011 15:08
Show Gist options
  • Save andrewytliu/1430402 to your computer and use it in GitHub Desktop.
Save andrewytliu/1430402 to your computer and use it in GitHub Desktop.
CRASH + HACKER = REBOOT
# CRASH
# +HACKER
# -------
# REBOOT
#
for vector in (0..9).to_a.permutation
a,b,c,e,h,k,o,r,s,t = vector
next if c == 0 or h == 0 or r == 0
crash = "#{c}#{r}#{a}#{s}#{h}".to_i
hacker = "#{h}#{a}#{c}#{k}#{e}#{r}".to_i
reboot = "#{r}#{e}#{b}#{o}#{o}#{t}".to_i
if crash + hacker == reboot
puts "#{crash} + #{hacker} = #{reboot}"
break
end
end
@2606younes
Copy link

@hamzaa1103
Copy link

11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment