Skip to content

Commit dcae13a

Browse files
committed
Fixed sonar
1 parent 33b5b9f commit dcae13a

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

3 files changed

+8
-8
lines changed

src/main/kotlin/g3301_3400/s3324_find_the_sequence_of_strings_appeared_on_the_screen/Solution.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class Solution {
1111
val tCh = target[i]
1212
cur.append('a')
1313
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]
1616
val nextCh = (if (lastCh == 'z') 'a'.code else lastCh.code + 1).toChar()
1717
cur.setCharAt(i, nextCh)
1818
ans.add(cur.toString())

src/main/kotlin/g3301_3400/s3325_count_substrings_with_k_frequency_characters_i/Solution.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ class Solution {
88
var result = 0
99
val count = IntArray(26)
1010
for (i in 0 until s.length) {
11-
val ch = s.get(i)
11+
val ch = s[i]
1212
count[ch.code - 'a'.code]++
1313

1414
while (count[ch.code - 'a'.code] == k) {
1515
result += s.length - i
16-
val atLeft = s.get(left)
16+
val atLeft = s[left]
1717
count[atLeft.code - 'a'.code]--
1818
left++
1919
}

src/main/kotlin/g3301_3400/s3327_check_if_dfs_strings_are_palindromes/Solution.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class Solution {
1818

1919
private fun dfs(x: Int) {
2020
l[x] = now + 1
21-
for (v in e.get(x)!!) {
21+
for (v in e[x]!!) {
2222
dfs(v!!)
2323
}
24-
stringBuilder.append(s!!.get(x))
24+
stringBuilder.append(s!![x])
2525
r[x] = ++now
2626
}
2727

@@ -30,7 +30,7 @@ class Solution {
3030
c[1] = '#'
3131
for (i in 1..n) {
3232
c[2 * i + 1] = '#'
33-
c[2 * i] = stringBuilder.get(i - 1)
33+
c[2 * i] = stringBuilder[i - 1]
3434
}
3535
var j = 1
3636
var mid = 0
@@ -57,7 +57,7 @@ class Solution {
5757
e.add(ArrayList<Int?>())
5858
}
5959
for (i in 1 until n) {
60-
e.get(parent[i])!!.add(i)
60+
e[parent[i]]!!.add(i)
6161
}
6262
l = IntArray(n)
6363
r = IntArray(n)

0 commit comments

Comments
 (0)