Created
February 1, 2022 22:35
-
-
Save mertceyhan/d72f83be6be8bbe04b35b2f6dce25a04 to your computer and use it in GitHub Desktop.
Answer of classic anagram question with Kotlin
This file contains 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
object Anagram { | |
fun isAnagram(firstText: String, secondText: String): Boolean { | |
return firstText.sumOf { it.code } == secondText.sumOf { it.code } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment