News for hackers. Stuff that matters.
Re:Getting a job at Apple without going to college or doing ... by ericbarrett on Thursday August 17, 2023 @07:40PM (#37169779)
You could return the 0s with a carry flag.
Re:Getting a job at Apple without going to college or doing ... by jeffbee on Thursday August 17, 2023 @08:34PM (#37170156)
It's still O(N) even if you don't need to copy the input, because you nonetheless visited every character in the string.
Re:Getting a job at Apple without going to college or doing ... by ericbarrett on Friday August 18, 2023 @05:34AM (#37173243)
Oh, I skimmed over the O(1) part. I'm baffled then. How do you calculate an N-rune string without O(N)?