Adjust testData to CharSequence.length transformation
This commit is contained in:
committed by
Mikhail Glukhikh
parent
cb562e7ea5
commit
f0e3fd617d
+1
-1
@@ -6,7 +6,7 @@ fun escapeChar(c : Char) : String? = when (c) {
|
||||
}
|
||||
|
||||
tailrec fun String.escape(i : Int = 0, result : StringBuilder = StringBuilder()) : String =
|
||||
if (i == length()) result.toString()
|
||||
if (i == length) result.toString()
|
||||
else escape(i + 1, result.append(escapeChar(get(i))))
|
||||
|
||||
fun box() : String {
|
||||
|
||||
+1
-1
@@ -4,5 +4,5 @@ tailrec fun String.repeat(num : Int, acc : StringBuilder = StringBuilder()) : St
|
||||
|
||||
fun box() : String {
|
||||
val s = "a".repeat(10000)
|
||||
return if (s.length() == 10000) "OK" else "FAIL: ${s.length()}"
|
||||
return if (s.length == 10000) "OK" else "FAIL: ${s.length}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user