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 {
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())
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments