Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage

hashCode and equals

Mission: Impossible

Report a typo

Ethan Hunt is ready for a new mission. To deactivate a chemical artifact, he must enter the secret numerical code corresponding to the text on the terminal screen. He only knows that this code is always the same if the displayed text is identical.

Sample Input 1:

Hello World!

Sample Output 1:

-969099747
Write a program in Kotlin
fun secretCode(text: String): Int {
// write your code here
}
___

Create a free account to access the full topic