Google OA

Max Distance

The distance between 2 binary strings is the sum of their lengths after removing the common prefix.

Given a list of binary strings, pick a pair that gives you maximum distance among all possible pairs and return that distance.

Example 1 :
Input:
binaryStrings = ["1011000", "1011110"]
Output:
6
Explanation:
The common prefix for these two numbers is 1011, so the distance is len("000") + len("110") = 3 + 3 = 6.