optimization: Scope access is now a Kotlin interface, compiler uses direct slot access also for closures
This commit is contained in:
1 parent
43a6a7aaf4
commit
6220e982a0
14 files changed
+438
-165
No files matched your search
@@ -4,15 +4,21 @@
|
||||
test the Lyng way. It is not meant to be effective.
|
||||
*/
|
||||
|
||||
fun naiveCountHappyNumbers() {
|
||||
fun naiveCountHappyNumbers(): Int {
|
||||
var count = 0
|
||||
for( n1 in 0..9 )
|
||||
for( n2 in 0..9 )
|
||||
for( n3 in 0..9 )
|
||||
for( n4 in 0..9 )
|
||||
for( n5 in 0..9 )
|
||||
for( n6 in 0..9 )
|
||||
for( n1 in 0..9 ) {
|
||||
for( n2 in 0..9 ) {
|
||||
for( n3 in 0..9 ) {
|
||||
for( n4 in 0..9 ) {
|
||||
for( n5 in 0..9 ) {
|
||||
for( n6 in 0..9 ) {
|
||||
if( n1 + n2 + n3 == n4 + n5 + n6 ) count++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
count
|
||||
}
|
||||
|
||||
@@ -28,4 +34,3 @@ for( r in 1..900 ) {
|
||||
assert( found == 55252 )
|
||||
delay(0.05)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user