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
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_6.java
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,20 @@
1
1
packagecom.fishercoder.solutions;
2
2
3
-
/**The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
3
+
/**
4
+
* 6. ZigZag Conversion
5
+
*
6
+
* The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this:
7
+
* (you may want to display this pattern in a fixed font for better legibility)
4
8
5
9
P A H N
6
10
A P L S I I G
7
11
Y I R
12
+
8
13
And then read line by line: "PAHNAPLSIIGYIR"
9
14
Write the code that will take a string and make this conversion given a number of rows:
10
15
11
16
string convert(string text, int nRows);
12
17
convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR".
0 commit comments