Commit 6d056cb

mo <mokha@cisco.com>
2017-08-12 19:15:22
sort the parts.
1 parent 94ed4bc
Changed files (1)
spec
spec/binary_trees/find_substrings_spec.rb
@@ -56,6 +56,7 @@ describe "#find_substrings" do
   #end
 
   def find_substrings(words, parts)
+    parts = parts.sort { |x, y| y.length <=> x.length }
     words.map do |word|
       current = nil
       length = nil