Palindrome Number | Leetcode problem 9

preview_player
Показать описание
Palindrome Number problem.
Leetcode problem number 9.

JAVA interview programming playlist:

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

you are doing very nice work mam , please upload some more videos on array 🙏🙏🙏

nilesh_dac
Автор

hey, it's not reversing the example -121 ad 121- , by logically it's also not possible because we are dealing with number no with string

int x=154;
int temp=x;

int rev=0;
while(x!=0){
rev= rev *10 + x%10;
x =x/10;
}

System.out.println(rev);

if (temp==rev){
System.out.println("Yes");
}else{
System.out.println("no")

AhmadRaza-ffrk
Автор

Can we also solve the same problem with help of for loop

amanparmar
Автор

I just have a silly questions?? How much time the loop run ???

SumitChouhan-sstt
Автор

I understood nothing.

1:59 from where did you get 10 and why it should be +2?

3:13 what?!

Just stopped watch after this.

exactly
Автор

what is the recursive solution of this

harshojha
Автор

vs code me public boolean method write kiya to code run nhi huwa kiyu

sumitSdhondikar
Автор

*why it's wrong??!!!*
(c++)

#include <iostream>
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<<"true" ;
}
else
cout<<"false" ;
}
else
{
cout<<"false" ;
}
return 0;
}

empty_peace
Автор

Can you tell why it is not wrking for negative number ??

zohebansari
Автор

IT DOES NOT WORK AS 1234567899 IS NOT A NOT IN RANGE

DOINGSOLUTIONS
Автор

if number is 11 then it will throw false

samadkhan
Автор

this is not going to work on all test case like number 10 and you didn't solve on leetcode...next time show your leetcode code also

JS_shorts_dev