text: Decrypt a string encrypted by repeating i | Java implementation of the approach ; Function to return the decrypted string ; Initial jump will be 1 ; Increment jump by 1 with every character ; Driver code
code: class GFG { static String decryptString ( String str , int n ) { int i = 0 , jump = 1 ; String decryptedStr = " " ; while ( i < n ) { decryptedStr += str . charAt ( i ) ; i += jump ; jump ++ ; } return decryptedStr ; } public static void main ( String [ ] args ) { String str = " geeeeekkkksssss " ; int n = str . length ( ) ; System . out . println ( decryptString ( str , n ) ) ; } }