Skip to content

Commit 5d01147

Browse files
refactor 496
1 parent ea92c82 commit 5d01147

File tree

1 file changed

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

1 file changed

+0
-26
lines changed

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

-26
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,6 @@
44
import java.util.Map;
55
import java.util.Stack;
66

7-
/**
8-
* 496. Next Greater Element I
9-
*
10-
* You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2.
11-
* Find all the next greater numbers for nums1's elements in the corresponding places of nums2.
12-
* The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. If it does not exist, output -1 for this number.
13-
14-
Example 1:
15-
Input: nums1 = [4,1,2], nums2 = [1,3,4,2].
16-
Output: [-1,3,-1]
17-
Explanation:
18-
For number 4 in the first array, you cannot find the next greater number for it in the second array, so output -1.
19-
For number 1 in the first array, the next greater number for it in the second array is 3.
20-
For number 2 in the first array, there is no next greater number for it in the second array, so output -1.
21-
22-
Example 2:
23-
Input: nums1 = [2,4], nums2 = [1,2,3,4].
24-
Output: [3,-1]
25-
Explanation:
26-
For number 2 in the first array, the next greater number for it in the second array is 3.
27-
For number 4 in the first array, there is no next greater number for it in the second array, so output -1.
28-
29-
Note:
30-
All elements in nums1 and nums2 are unique.
31-
The length of both nums1 and nums2 would not exceed 1000.
32-
*/
337
public class _496 {
348

359
public static class Solution1 {

0 commit comments

Comments
 (0)