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
| 0019 |[Remove Nth Node From End of List](src/main/c/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.c)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Two_Pointers, Linked_List, Big_O_Time_O(L)_Space_O(L) | 0 | 100.00
| 0019 |[Remove Nth Node From End of List](src/main/c/g0001_0100/s0019_remove_nth_node_from_end_of_list/Solution.c)| Medium | Top_100_Liked_Questions, Top_Interview_Questions, Two_Pointers, Linked_List, Big_O_Time_O(L)_Space_O(L) | 0 | 100.00
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)
6
+
7
+
P A H N A P L S I I G Y I R
8
+
9
+
And then read line by line: `"PAHNAPLSIIGYIR"`
10
+
11
+
Write the code that will take a string and make this conversion given a number of rows:
12
+
13
+
string convert(string s, int numRows);
14
+
15
+
**Example 1:**
16
+
17
+
**Input:** s = "PAYPALISHIRING", numRows = 3
18
+
19
+
**Output:** "PAHNAPLSIIGYIR"
20
+
21
+
**Example 2:**
22
+
23
+
**Input:** s = "PAYPALISHIRING", numRows = 4
24
+
25
+
**Output:** "PINALSIGYAHRPI"
26
+
27
+
**Explanation:** P I N A L S I G Y A H R P I
28
+
29
+
**Example 3:**
30
+
31
+
**Input:** s = "A", numRows = 1
32
+
33
+
**Output:** "A"
34
+
35
+
**Constraints:**
36
+
37
+
*`1 <= s.length <= 1000`
38
+
*`s` consists of English letters (lower-case and upper-case), `','` and `'.'`.
Given a signed 32-bit integer `x`, return `x`_with its digits reversed_. If reversing `x` causes the value to go outside the signed 32-bit integer range <code>[-2<sup>31</sup>, 2<sup>31</sup> - 1]</code>, then return `0`.
6
+
7
+
**Assume the environment does not allow you to store 64-bit integers (signed or unsigned).**
8
+
9
+
**Example 1:**
10
+
11
+
**Input:** x = 123
12
+
13
+
**Output:** 321
14
+
15
+
**Example 2:**
16
+
17
+
**Input:** x = -123
18
+
19
+
**Output:** -321
20
+
21
+
**Example 3:**
22
+
23
+
**Input:** x = 120
24
+
25
+
**Output:** 21
26
+
27
+
**Example 4:**
28
+
29
+
**Input:** x = 0
30
+
31
+
**Output:** 0
32
+
33
+
**Constraints:**
34
+
35
+
* <code>-2<sup>31</sup> <= x <= 2<sup>31</sup> - 1</code>
0 commit comments