This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun main() { | |
| println(palindromeIndex("aaa")) | |
| } | |
| fun palindromeIndex(s: String): Int { | |
| val reversed = s.reversed() | |
| if (s == reversed) return -1 | |
| for (i in 0 until s.length) { | |
| var countLeft = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity | |
| import android.app.Service | |
| import android.content.ComponentName | |
| import android.content.Context | |
| import android.content.Intent | |
| import android.content.Intent.EXTRA_SUBJECT | |
| import android.content.Intent.EXTRA_TEXT | |
| import android.net.Uri | |
| import kotlin.properties.ReadWriteProperty | |
| import kotlin.reflect.KClass |