Skip to content

Commit

Permalink
Added Reverse String from hacker rank
Browse files Browse the repository at this point in the history
  • Loading branch information
javasks committed Feb 27, 2020
1 parent 54f7de2 commit 789c959
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions src/com/sks/hkr/ReverseString.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.sks.hkr;

import java.util.*;

public class ReverseString {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);
String A=sc.next();
/* Enter your code here. Print output to STDOUT. */
char ch[]=A.toCharArray();
String rev="";
for(int i=ch.length-1;i>=0;i--){
rev+=ch[i];
}
if(A.equals(rev)){
System.out.println("Yes");
}else{
System.out.println("No");
}

}
}




0 comments on commit 789c959

Please sign in to comment.