Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>I didn't get the job.

Their loss. Expecting an arithmetic solution to be necessary is incongruous with accepting the overhead of Python. IIRC your approach will actually be faster; the string conversion implicitly number-crunches on the bare metal, whereas any arithmetic approach in Python code won't.

Unless they wanted you to convert back to int afterwards. Or wanted you to reverse the string with the slicing trick (which is, indeed, quite a bit faster yet).



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

Search: