You are viewing a single comment's thread. Return to all comments →
This worked for me..
int rows = 0, cols = 0, i, j = 0; StringBuffer sb = new StringBuffer();
//rows = (int)Math.floor(Math.pow(s.length(), 0.5)); cols = (int)Math.ceil(Math.pow(s.length(), 0.5)); for(i = 0; i < cols; i++) { for(j = i; j < s.length(); j += cols) { sb.append(s.charAt(j)); } sb.append(" "); } return sb.toString();
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
This worked for me..
int rows = 0, cols = 0, i, j = 0; StringBuffer sb = new StringBuffer();