This week, Liz explores how to solve a medium Stack question.
The Challenge (Medium):
Given two arrays of integers, nums1 and nums2 where nums1 is a subset of nums2, find the next greater integer in nums2 for each integer in nums1.
Video Overview:
0:20 Problem overview
3:15 The naive approach
3:57 Live code naive approach
9:03 Optimized approach using a stack
16:31 Live code optimized approach
21:58 Big O
Please subscribe to our channel :)
Additional Resources:
Practice hundreds of real coding challenges at https://coderbyte.com/