Lesson 22 of 34

String Problems: Reverse, Palindrome, CountString Problems: Reverse, Palindrome, Count

10 min 30 XP

String-ஐ எழுத்து எழுத்தாக loop செய்ய charAt(i) அல்லது toCharArray() பயன்படுத்துங்கள். Reverse, palindrome, vowels எண்ணுதல் ஆகியவை campus interviews-ல் மிகவும் பிரபலம்.

Loop over a String character by character with charAt(i) or toCharArray(). Reversing, palindromes and counting vowels are campus-interview favourites.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Character.isDigit(ch), Character.isLetter(ch), Character.isUpperCase(ch) ஆகியவை ஒரு எழுத்தின் வகையைச் சொல்லும்.

Character.isDigit(ch), Character.isLetter(ch) and Character.isUpperCase(ch) tell you what kind of character you have.

Challenge

+30 XP

ஒரு சொல்லைப் படித்து, அது palindrome ஆக இருந்தால் "Palindrome", இல்லையெனில் "Not palindrome" என்று print செய்யுங்கள். Capital/small எழுத்து வேறுபாட்டைக் கவனிக்க வேண்டாம் (Madam ஒரு palindrome).

Read a word. Print "Palindrome" if it reads the same backwards, otherwise "Not palindrome". Ignore capital letters (Madam is a palindrome).

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.