Commit 9a03cbf

mo <mokha@cisco.com>
2017-06-17 15:14:24
collapse line.
1 parent 718a139
Changed files (1)
lib/detect_circles.rb
@@ -11,11 +11,10 @@ def circle?(head)
 
   until hare.nil?
     return true if tortoise == hare
-    tortoise = tortoise.next_item
-    hare = hare.next_item&.next_item
+    tortoise, hare = tortoise.next_item, hare.next_item&.next_item
   end
 
-  return false
+  false
 end
 
 class Node