|
|
|
|
|
by WalterGR
2770 days ago
|
|
Would you be looking for the solution where you subtract every number in the array from 5050? If anyone says that they 99% studied it. I was asked this exact question at my on-campus interview with one of the Big Five software companies for a Program Manager internshi between my 3rd and 4th years of college. I had done no “leetcode grinding”-style prep. Subtract from 5050? No, I didn’t think of that. But I did think of summing the numbers 1..100 with a for loop, sum the numbers in the input array, and subtract. Not the perfect solution. But it’s O(n). And I did get the internship. My point being not that I’m some kind of algorithmic prodigy: I’m very much not. But if a college kid can solve it without any prep, nor rote memorization as GP suggests... |
|