File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
src/main/kotlin/g3301_3400
s3324_find_the_sequence_of_strings_appeared_on_the_screen
s3325_count_substrings_with_k_frequency_characters_i
s3327_check_if_dfs_strings_are_palindromes Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ class Solution {
11
11
val tCh = target[i]
12
12
cur.append(' a' )
13
13
ans.add(cur.toString())
14
- while (cur.get(i) != tCh) {
15
- val lastCh = cur.get(i)
14
+ while (cur[i] != tCh) {
15
+ val lastCh = cur[i]
16
16
val nextCh = (if (lastCh == ' z' ) ' a' .code else lastCh.code + 1 ).toChar()
17
17
cur.setCharAt(i, nextCh)
18
18
ans.add(cur.toString())
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ class Solution {
8
8
var result = 0
9
9
val count = IntArray (26 )
10
10
for (i in 0 until s.length) {
11
- val ch = s.get(i)
11
+ val ch = s[i]
12
12
count[ch.code - ' a' .code]++
13
13
14
14
while (count[ch.code - ' a' .code] == k) {
15
15
result + = s.length - i
16
- val atLeft = s.get( left)
16
+ val atLeft = s[ left]
17
17
count[atLeft.code - ' a' .code]--
18
18
left++
19
19
}
Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ class Solution {
18
18
19
19
private fun dfs (x : Int ) {
20
20
l[x] = now + 1
21
- for (v in e.get(x) !! ) {
21
+ for (v in e[x] !! ) {
22
22
dfs(v!! )
23
23
}
24
- stringBuilder.append(s!! .get(x) )
24
+ stringBuilder.append(s!! [x] )
25
25
r[x] = ++ now
26
26
}
27
27
@@ -30,7 +30,7 @@ class Solution {
30
30
c[1 ] = ' #'
31
31
for (i in 1 .. n) {
32
32
c[2 * i + 1 ] = ' #'
33
- c[2 * i] = stringBuilder.get( i - 1 )
33
+ c[2 * i] = stringBuilder[ i - 1 ]
34
34
}
35
35
var j = 1
36
36
var mid = 0
@@ -57,7 +57,7 @@ class Solution {
57
57
e.add(ArrayList <Int ?>())
58
58
}
59
59
for (i in 1 until n) {
60
- e.get( parent[i]) !! .add(i)
60
+ e[ parent[i]] !! .add(i)
61
61
}
62
62
l = IntArray (n)
63
63
r = IntArray (n)
You can’t perform that action at this time.
0 commit comments