Leetcode 9. Palindrome Number [Java]

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ส.ค. 2024
  • Check out how to solve the leetcode 9 Palindrome Number question in Java.
    Question URL: leetcode.com/p...
    Please write in the comments below which leetcode problem you want me to solve next.
    And remember, a leetcode a day keeps unemployment away!
    Thanks for watching!
    #leetcode9

ความคิดเห็น • 4

  • @luisaceo00
    @luisaceo00 2 ปีที่แล้ว

    Awesome bro)) I was able to do this question pretty easily but wanted to check how to do it without string conversion like you show in the video. Spasibo!

    • @ifelsestatement7803
      @ifelsestatement7803  2 ปีที่แล้ว +1

      String conversion would not give you a good offer in a prestigious company if this exact problem would appear in an interview. Always think not about just how to solve the problem but how to solve the problem in a most efficient day! And remember, leetcode a day keeps sh**ty unemployment away! All the best and thanks for watching!

  • @coding615
    @coding615 ปีที่แล้ว

    thank you

  • @empty_peace
    @empty_peace ปีที่แล้ว

    *why it's wrong??!!!*
    (c++)
    #include
    using namespace std;
    int main()
    {
    int x ;
    cin>>x;
    int n = x ;
    if(x > 0)
    {
    int rev = 0 ;
    while(x > 0)
    {
    rev = (rev*10) + (x%10) ;
    x /= 10 ;
    }
    if(n == rev)
    {
    cout