Added 15 solutions

This commit is contained in:
rshaghoulian
2017-02-07 01:14:49 -08:00
parent 692821a288
commit b06588fddf
15 changed files with 406 additions and 0 deletions
@@ -0,0 +1,16 @@
import java.util.Scanner;
/* If a String is equivalent to itself when reversed, it's a palindrome */
public class Solution {
public static void main(String[] args) {
/* Read input */
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
scan.close();
/* Reverse string and compare to original */
String reversed = new StringBuilder(str).reverse().toString();
System.out.println(str.equals(reversed) ? "Yes" : "No");
}
}