We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Encryption
- Discussions
Encryption
Encryption
Sort by
recency
|
1478 Discussions
|
Please Login in order to post a comment
Kotlin solution with O(n)
PHP:
PHP
Haskell:
public static String encryption(String s) { StringBuilder result = new StringBuilder(); s = s.replaceAll("\s", ""); int n = s.length(); int row = (int) Math.sqrt(n); int column = (row * row == n) ? row : row + 1; for (int i = 0; i < column; i++) { for (int j = i; j < n; j += column) { result.append(s.charAt(j)); } result.append(" ");