Reverse Integer | LeetCode problem 7

Sdílet
Vložit
  • čas přidán 28. 09. 2022
  • Reverse Integer
    Leetcode problem number 5
    Solution in JAVA
    JAVA interview programming playlist:
    • Interview Programming ...
    Linkedin: / amrita-bala-a2b79460
    #java #interviewquestions #leetcode
  • Věda a technologie

Komentáře • 25

  • @gautamhelange2769
    @gautamhelange2769 Před rokem +4

    Wow! You handled overflow condition greatly, Thank You!

  • @faizuddin4032
    @faizuddin4032 Před 4 dny

    Great explanation, but it would be great if you use dark theme on leetcode

  • @soullover8484
    @soullover8484 Před 11 měsíci

    Good explanation amrutha

  • @ayomiposolaja2016
    @ayomiposolaja2016 Před 3 měsíci

    Great explanation. Thank you.

  • @dboss616
    @dboss616 Před rokem

    Great explanation thank you😄👍

  • @abhijitbiradar
    @abhijitbiradar Před rokem

    great explanation !!!

  • @ssdnews2863
    @ssdnews2863 Před rokem

    very well explained ! tysm

  • @niraj.suryavanshi_
    @niraj.suryavanshi_ Před rokem

    Great !!

  • @Ganesh-mz1cd
    @Ganesh-mz1cd Před 5 měsíci

    great Work !

  • @sonammurarkar961
    @sonammurarkar961 Před 7 měsíci

    Amazing explanation

  • @ganeshjaggineni4097
    @ganeshjaggineni4097 Před měsícem

    NICE SUPER EXCELLENT MOTIVATED

  • @Sufferingitbastards369
    @Sufferingitbastards369 Před rokem +2

    Amazing...keep up the good work. I like the way you break down the problem on white board but please slow it down a little bit when you code.

  • @dushyant6229
    @dushyant6229 Před 6 měsíci

    Really helpful

  • @princeprasad973
    @princeprasad973 Před rokem

    thankuu...😇

  • @sujatamahata3128
    @sujatamahata3128 Před rokem

    Thank you Di😊

  • @kamleshlohani6149
    @kamleshlohani6149 Před rokem

    Amazing

  • @mayanksinghal1400
    @mayanksinghal1400 Před 21 dnem

    Hello.. Thankyou for this video.
    Can you explain please why can't we use overflow condition like
    if (rev*10 > Integer.MAX_VALUE || rev*10 < Integer.MIN_VALUE)

  • @KRajesh-ej7dy
    @KRajesh-ej7dy Před rokem

    Hello mam if rev>max or min we need to get output as 0 then y it is returning garbage value .Leet code is not accepting this code...

    • @TechnosageLearning
      @TechnosageLearning  Před rokem

      Hi .. It is giving 0 only when rev> max or min. .I have shown in the video ,when we don't consider that condition , it would give garbage value.. I think you missed the end part of video.. Please try the code from git repo.. Leetcode is accepting the code.. Thanks!

  • @sanjaykumarpandey4325
    @sanjaykumarpandey4325 Před měsícem +1

    Why you are dividing by 10 to check overflow condition

    • @prateekkumar299
      @prateekkumar299 Před měsícem

      reversed * 10 > INT_MAX would mean performing the multiplication first which could already cause overflow

  • @devendramishra5872
    @devendramishra5872 Před rokem

    ye gys kaha se aa gya ?
    didi

  • @user-bl1gg1ff1q
    @user-bl1gg1ff1q Před 6 měsíci

    import java.util.*;
    class Main {
    public static void main (String [] args){
    int nums=4567;
    System.out.print(reverseInt(nums)) ;
    }
    public static int reverseInt(int n) {
    int rev=0;
    while(n>0){
    int Lastdigit=n%10;
    n=n/10;
    rev=rev*10+Lastdigit;
    }
    return rev;
    }
    }