You have two arrays: nums1 (a subset of nums2) and nums2. For each element in nums1, find its next greater element in nums2. The next greater element of x in nums2 is the first element to the right that is larger than x. Example: nums1 = [,,], nums2 = [,,,]. Output: [,,]. For : nothing greater to its right, so . For : next greater is . For : nothing greater to its right, so .
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/stacks/problem-next-greater-element-i
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████████████████████