Skip to content

Commit 289c233

Browse files
refactor 457
1 parent 040085f commit 289c233

File tree

1 file changed

+0
-19
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-19
lines changed

src/main/java/com/fishercoder/solutions/_457.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 457. Circular Array Loop
5-
*
6-
* You are given an array of positive and negative integers.
7-
* If a number n at an index is positive, then move forward n steps.
8-
* Conversely, if it's negative (-n), move backward n steps.
9-
*
10-
* Assume the first element of the array is forward next to the last element,
11-
* and the last element is backward next to the first element.
12-
* Determine if there is a loop in this array.
13-
* A loop starts and ends at a particular index with more than 1 element along the loop. The loop must be "forward" or "backward'.
14-
*
15-
* Example 1: Given the array [2, -1, 1, 2, 2], there is a loop, from index 0 -> 2 -> 3 -> 0.
16-
* Example 2: Given the array [-1, 2], there is no loop.
17-
*
18-
* Note: The given array is guaranteed to contain no element "0".
19-
*
20-
* Can you do it in O(n) time complexity and O(1) space complexity?
21-
*/
223
public class _457 {
234
public static class Solution1 {
245
/**

0 commit comments

Comments
 (0)