Paul loves to ride public transportation, and after receiving a ticket, he immediately checks whether he got the lucky one. A ticket is considered lucky if the sum of the first three digits in this ticket matches the sum of the last three digits in the same ticket.
However, Paul does not count well in his mind. That is why he asks you to write a program that will check the equality of the sums and display "Lucky" if the sums match, and "Regular" if the sums differ.
A string of six digits is provided as input to the program.
You need to print out only the word "Lucky" or "Regular" with a capital letter (without quotes).
Tip:
To get the int value that the character actually represents, you can use one of these methods:
val charValue = '2'
val intValue0 = charValue.digitToInt() //2
val intValue1 = charValue.toString().toInt() // 2
val intValue2 = Character.getNumericValue(charValue) // 2 Here is an incorrect way to get the int value because toInt() returns the ASCII code of the character:
val charValue = '2'
val intValue = charValue.toInt() // 50, which is ASCII code for character ‘2’