• + 0 comments

    public static String encryption(String s) { // Write your code here s=s.replaceAll("\s",""); int len = s.length(); double L = Math.sqrt(len); int r = (int)Math.floor(L); int c = (int)Math.ceil(L); int n; n = r*c; if(nlen){ en[i] = s.substring(j,len); } else{ en[i] = s.substring(j,j+c); j = j+c; } } String out=""; for(int i=0;ien[j].length()-1) continue; else out += en[j].charAt(i);

                                    ![]([](https://)https://)
                    }
                    out += " ";
            }
            return out;
    **}