File tree 1 file changed +0
-16
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .util .Stack ;
4
4
5
- /**
6
- * 503. Next Greater Element II
7
- *
8
- * Given a circular array (the next element of the last element is the first element of the array),
9
- * print the Next Greater Number for every element.
10
- * The Next Greater Number of a number x is the first greater number to its traversing-order next in the array,
11
- * which means you could search circularly to find its next greater number. If it doesn't exist, output -1 for this number.
12
-
13
- Example 1:
14
- Input: [1,2,1]
15
- Output: [2,-1,2]
16
- Explanation: The first 1's next greater number is 2;
17
- The number 2 can't find next greater number;
18
- The second 1's next greater number needs to search circularly, which is also 2.
19
- Note: The length of given array won't exceed 10000.
20
- */
21
5
public class _503 {
22
6
23
7
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments