Leetcode 7 - Bit Manipulation | Reverse Integer

preview_player
Показать описание
Topic: Bit Manipulation *Note* - Please see pinned comment for slight clarification!

Code:

Leetcode:

*Note* I claim no rights to this question. All rights belong to Leetcode. If I'm reviewing a solution that was from another Leetcode user or Leetcode itself I will give credit below.

Рекомендации по теме
Комментарии
Автор

t == 7
return 0;

What if t is 8 or 9?

pawanbishnoi
Автор

Come from leetcode, and thanks for explanation.

rebertliu
Автор

Cool video. Subscribed. Only suggestion is black marker to increase contrast. And maybe thicker marker to further increase readability on mobile

shimanopower
Автор

Correction: t > 7 for Integer.MAX_VALUE and t < -8 for Integer.MIN_VALUE in the checks.

DevendraLattu
Автор

Thanks for the video, man! Where are bits manipulations here? 🤔

algoseekee
Автор

Thank you so much for your video. 
I am just still confused that why we need to consider (res>int.max/10) || (res==int.max/10 && t >7) seperately, why not:
if res > (int.max - t) / 10?
❤️Thanks again! Your video is good!!

xinting_study
Автор

Next time after the code do a dry run with an example will be better for new ones in Algorithm world

TomarSahabVlogs
Автор

Nice job, but few mistakes. -2^31 should be -2147483648, not 2147483648 (you forgot the negative). And the variable "res" should be called "rev", ya know, like reverse (the name of the function). Also, go slower and explain the steps more clearly. I understood, but would get more out of it if you elaborate on each step, especially for very new beginners. Good luck man!

JohnnyFive
visit shbcf.ru