@@ -0,0 +1,1536 @@
+import java.io.*;%0Aimport java.util.*;%0A%0Aclass Palindrome %7B%0A%0A%09private Stack%3CCharacter%3E stack;%0A%09private LinkedList%3CCharacter%3E queue;%0A%0A%09public Palindrome() %7B%0A%09%09stack = new Stack%3CCharacter%3E();%0A%09%09queue = new LinkedList%3CCharacter%3E();%0A%09%7D%0A%0A%09public void pushCharacter( char ch ) %7B%0A%09%09stack.push( ch );%0A%09%7D%0A%0A%09public void enqueueCharacter( char ch ) %7B%0A%09%09queue.add( ch );%0A%09%7D%0A%0A%09public char popCharacter() %7B%0A%09%09return stack.pop();%0A%09%7D%0A%0A%09public char dequeueCharacter() %7B%0A%09%09return queue.removeFirst();%0A%09%7D%0A%0A%7D%0A%0Apublic class Solution %7B%0A%0A%09public static void main( String%5B%5D args ) %7B%0A%09%09Scanner sc = new Scanner( System.in );%0A%09%09// read the string s.%0A%09%09String s = sc.nextLine();%0A%0A%09%09// create the Palindrome class object p.%0A%09%09Palindrome p = new Palindrome();%0A%09%09char arr%5B%5D = s.toCharArray();// Converting string to a character array%0A%09%09// push all the characters of string s to stack.%0A%09%09for ( char c : arr ) %7B%0A%09%09%09p.pushCharacter( c );%0A%09%09%7D%0A%0A%09%09// enqueue all the characters of string s to queue.%0A%09%09for ( char c : arr ) %7B%0A%09%09%09p.enqueueCharacter( c );%0A%09%09%7D%0A%0A%09%09boolean f = true;%0A%0A%09%09// pop the top character from stack.%0A%09%09// dequeue the first character from queue.%0A%09%09// compare both the characters.%0A%09%09for ( int i = 0; i %3C s.length(); i++ ) %7B%0A%09%09%09if ( p.popCharacter() != p.dequeueCharacter() ) %7B%0A%09%09%09%09f = false;%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09// finally print whether string s is palindrome or not.%0A%09%09if ( f ) %7B%0A%09%09%09System.out.println( %22The word, %22 + s + %22, is a palindrome.%22 );%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09System.out.println( %22The word, %22 + s + %22, is not a palindrome.%22 );%0A%09%09%7D%0A%0A%09%09sc.close();%0A%09%7D%0A%0A%7D%0A

Add day 18 solution