You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Simple Simulation on Matrix Zig Zagly and first loop mein col ko constant rkho second loop ke andr column to increase krte jao because of zig zag motion
if (numRows == 1) {
return s;
}
String[][] matrix = new String[numRows][s.length()];
int pointer = 0;
int col = 0;
while (pointer < s.length()) {
for (int i = 0; i < numRows && pointer < s.length(); i++) {