From 3e501ec2451e9b844959cefa2686bbe238b24e5c Mon Sep 17 00:00:00 2001 From: Abhisheksenga <31212259+Abhisheksenga@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:26:57 +0530 Subject: [PATCH] Decryption.java Code for decrypting encrypted string back to original string. This is the new question comes in java (Basics) certification. input = "sd2en" output = "needs" --- .../implementation/bruteforce/Decryption.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 HackerRankDashboard/CoreCS/Implementation/src/main/java/org/javaaid/hackerrank/solutions/implementation/bruteforce/Decryption.java diff --git a/HackerRankDashboard/CoreCS/Implementation/src/main/java/org/javaaid/hackerrank/solutions/implementation/bruteforce/Decryption.java b/HackerRankDashboard/CoreCS/Implementation/src/main/java/org/javaaid/hackerrank/solutions/implementation/bruteforce/Decryption.java new file mode 100644 index 0000000..d098d99 --- /dev/null +++ b/HackerRankDashboard/CoreCS/Implementation/src/main/java/org/javaaid/hackerrank/solutions/implementation/bruteforce/Decryption.java @@ -0,0 +1,35 @@ + +public class Decryption { + + static String decryption(String s) { + StringBuilder s1 = new StringBuilder(); + String result =""; + s1.append(s); + s=s1.reverse().toString(); + char[] chars = s.toCharArray(); + s1.delete(0,chars.length); + for(int i=0;i