DSA Key Problems

Next Greater Element

Given two arrays of distinct values where the first is a subset of the second, return for each first-array value the first greater value to its right in the second array, or -1 if none exists.