Spoj solutions in Ruby