Commit eb96a99
Changed files (1)
lib/detect_circles.rb
@@ -1,6 +1,10 @@
<<-DOC
You are given a single linked list, and you are asked to determine if there is a circle inside it
A circle means, a -> b -> c -> b, then it is a circle
+
+Part 2.
+Could you get the length of the circle for the input single linked list if there is one, or output 0 if there is no circle? (O(1) space and O(n) time complexity)
+
DOC
require 'byebug'