Outstanding explanation. And love your voice as well .❤
@gamifycoding8927
2 жыл бұрын
Very easy to learn 👍
@dbvs007
2 жыл бұрын
Great contents, thank you.. You can solve with less time complexity by just comparing first half of string with last half of string. Below is optimized code snippet !! public boolean isPalindrome(String strInput){ int midIndex = strInput.length()/2; int firstIndex=0; int lastIndex=strInput.length()-1; boolean isPalindromeflag=false; while(midIndex>=0){ if(strInput.charAt(firstIndex)==strInput.charAt(lastIndex)){ firstIndex++; lastIndex--; isPalindromeflag=true; } else break; midIndex--; } return isPalindromeflag;
@AbdulKhan-br7jn
Жыл бұрын
Awesome❤
@moonXminyo
11 ай бұрын
So easy ❤ thank you sir ❤
@SubhamDas-tb3xf
7 ай бұрын
Two pointer - for 1st approach
@pavanvarma2860
Ай бұрын
💥
@MNCO007
2 жыл бұрын
Yes explain brief sir
@moulkarshankar4765
9 ай бұрын
Thanku so much bro❤
@Misturikan
Жыл бұрын
Thankyou sir
@TAPACADEMY
Жыл бұрын
Your welcome. Do subscribe to the channel.
@doods6721
2 жыл бұрын
Loved
@PoojaGupta-bf5yi
8 ай бұрын
Yes
@ameyrichadevasahayamitstud3740
4 ай бұрын
class Solution { public String is_palindrome(int n) { // Code here int reverse = 0, copy = n ; if(n0){ int ld = n % 10 ;// ,mom % 10 = m reverse = (reverse * 10) + ld ;// (0)+m = m n = n/10; // mom / 10 = mo } if(reverse == copy){ return "Yes"; } return "No"; } };
Пікірлер: 15