7 ms·
I am curious to what the Python solution was, since the C requirement was to do it "in place".
by mdg 16y ago
I am curious to what the Python solution was, since the C requirement was to do it "in place".
- masterj 16y agoI suppose you could first convert the string to a list of characters and use integers as a replacement for pointers. You could then modify the list in place.
- deleted 16y ago[deleted]
- SMrF 16y agoI submitted the python solution. I changed the problem to accept a list. I was guessing this preserved the integrity of the problem, although I don't really know C so I couldn't be certain. I explained as much when I emailed my solution.
- conover 16y agoI had the same thought. You would have to be passed a list I guess but then that kind of changes the problem.
- mdg 16y agoI worked it out with converting z_terminated to a list inside condense_by_removing, and then returning "".join(z_terminated), but yea it does change the problem