Coding Interview Tutorial 66: String to Integer [LeetCode]

preview_player
Показать описание
Learn how to convert a string to an integer in O(n) time, where n is the length of the string.

This is an important programming interview question, and we use the LeetCode platform to solve this problem.
Рекомендации по теме
Комментарии
Автор

We all hate lengthy solution this is why this one is awesome. Clear and concise easy to follow

abdoulbarry
Автор

wow! this is a simple and clean solution. keep doing the good work. Thank you so much.

sureshgarine
Автор

u r amazing continue your work really awsome

lifehacks
Автор

Quite good solution. But you only ignore single space - what about other whitespace characters (e.g. tab)?

mathiasstocker
Автор

in horner's rule why we subtract 0. str.charAt(i++) - '0'

abdullahalnoman
Автор

Good solution though I think using a long is kind of cheating if you want to respect the second point in the "Notes" : "Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range [...]".

getmoonez
Автор

i think if u will upload vedios on topic explaination then it will help u to increase subscriber

lifehacks
Автор

Thanks for the video! In like 14 why do you subtract '0' from str.charAt(i)?

thndesmondsaid
Автор

Man who are you a genius or a super genius in programming

biswamohandwari
Автор

dude using long makes it too convenient and i think that's not the point

himanshunahak