ArraysEasy
What pattern does this problem use?
A warehouse stores products in sorted order by SKU number. Given the sorted SKU list and a target SKU, return the index of that SKU in the list. Return -1 if it's not there. The list can have millions of entries, so a linear scan is too slow.
Example: skus = [1021, 3047, 5512, 7889, 9001], target = 5512 → 2
Pick a pattern: