Skip to content

Instantly share code, notes, and snippets.

View go-cristian's full-sized avatar
💭
Never stop learning!

Cristian Gómez go-cristian

💭
Never stop learning!
View GitHub Profile
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
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