Help needed in array problem

Basically there has to be a binary prefix that is present in all. So we iterate through all prefixes of the first element and check whether it’s in all others. If it is, we find the number of operation by appending 0s to the value we are trying to make everything equal and checking all of them. Whichever has the least, we use that. Also there are some number of operation needed to get all of them into that prefix. That minimum no. of operation and the place where it would
start(by counting the number of suceeding 0s) is stored in prefixes.

1 Like