Search Insert Position
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You must write an algorithm with O(log n) runtime complexity.
LeetCode Pro...
perfinsights.hashnode.dev2 min read
Vitaly Sazanovich
But the array is sorted, right? Please take a loook at Arrays.binarySearch in Java: docs.oracle.com/javase/8/docs/api/java/util/Array… Implementation: github.com/openjdk/jdk11/blob/master/src/java.bas…