Alarm clock

Report a typo

Write a function that simulates an alarm clock. Initially, the function prints It's time to get up!, after one second the function should print You overslept by <TIME> seconds, it's time to get up! every second, where TIME is incremented every second.

Sample Input 1:

Sample Output 1:

It's time to get up!
You overslept by 1 seconds, it's time to get up!
You overslept by 2 seconds, it's time to get up!
You overslept by 3 seconds, it's time to get up!
You overslept by 4 seconds, it's time to get up!
You overslept by 5 seconds, it's time to get up!
Write a program in Kotlin
import java.util.concurrent.*

// do not change this code
val executor: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor()

fun alarm() {
// write here
}
___

Create a free account to access the full topic