File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 541. Reverse String II
5
- *
6
- * Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string.
7
- * If there are less than k characters left, reverse all of them.
8
- * If there are less than 2k but greater than or equal to k characters, then reverse the first k characters and left the other as original.
9
-
10
- Example:
11
- Input: s = "abcdefg", k = 2
12
- Output: "bacdfeg"
13
-
14
- Restrictions:
15
- The string consists of lower English letters only.
16
- Length of the given string and k will in the range [1, 10000]
17
- */
18
3
public class _541 {
19
4
20
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments