Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(a)
- answer_xored = 0
- lower_xors = 0
- a.each do |e|
- answer_xored = answer_xored ^ e
- end
- a.each do |e|
- solution_pairing = e ^ answer_xored
- lower_num = [e, solution_pairing].min
- if e == lower_num
- lower_xors = lower_xors ^ e
- end
- end
- return [lower_xors, lower_xors ^ answer_xored]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement