| Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
|---|---|---|---|---|---|---|
| 1 | Ruby | 178 | 83 | 95 | 2 days ago | |
| 2 | Kotlin | 236 | 97 | 139 | 18 hours ago | |
| 3 | C++ | 276 | 127 | 149 | 2 days ago | |
| 4 | Python | 317 | 148 | 169 | 2 days ago | |
| 5 | Kotlin | 386 | 172 | 214 | 3 days ago | |
| 6 | C | 417 | 188 | 229 | 2 days ago |
funmain(){ valchars=generateSequence(::readLine).toMutableList().map{it.toMutableList()} fungetChar(x:Int,y:Int)=chars.getOrNull(x)?.getOrNull(y) varcount=0 varprevCount=-1 while(count!=prevCount){ prevCount=count chars.forEachIndexed{x,row-> row.forEachIndexed{y,char-> if(char=='@'&&listOfNotNull( getChar(x-1,y-1), getChar(x-1,y), getChar(x-1,y+1), getChar(x,y-1), getChar(x,y+1), getChar(x+1,y-1), getChar(x+1,y), getChar(x+1,y+1), ).count{it=='@'}<4 ){ count++ chars.getOrNull(x)?.set(y,' ') } } } } println(count)}