You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning! Here's your coding interview problem for today.
This problem was asked by Netflix.
Given a sorted list of integers of length N, determine if an element x is in the list without performing any multiplication, division, or bit-shift operations.
you performed a division in your binary search! I think that is why it's considered hard!
@mgkeeley I forgot to link the follow-on PRs to this issue that fixed that mistake. If you're interested please take a look at the revised solution. I used this algorithm to divide by 2 without multiplication, division or bit shifting.
Activity
vaskoz commentedon May 20, 2019
The weird part of this question is that it's classified as hard despite it appearing to be a simple binary search.
mgkeeley commentedon Feb 12, 2020
you performed a division in your binary search! I think that is why it's considered hard!
vaskoz commentedon Feb 12, 2020
@mgkeeley I forgot to link the follow-on PRs to this issue that fixed that mistake. If you're interested please take a look at the revised solution. I used this algorithm to divide by 2 without multiplication, division or bit shifting.
SwapnilJavanjal commentedon Feb 18, 2020
Anyone got answer?