Hacker News new | past | comments | ask | show | jobs | submit login

I would answer :

    def reverse(str):
        return str[::-1]
Am I missing the point ?



That creates a new string (the one returned) :)


Thats what I would do. Then again, I always get rejected when I do these type of interviews...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: