|
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".
|
13 |
| -
|
14 | 18 | */
|
15 | 19 |
|
16 | 20 | publicclass_6 {
|
|