The shortest stack

Report a typo

As you know, a very long stack may lead to StackOverflowError.

In this problem, you need to invoke a function in main to create the shortest stack. Your program should print "Hello!" exactly three times.

fun q() {
    println("Hello!")
    println("Hello!")
}

fun f() {
    println("Hello!")
    q()
}

fun g() {
    println("Hello!")
    println("Hello!")
    println("Hello!")
}

fun h() {
    g()
}

fun main() {
    // What should be invoked here to get the shortest stack?
}
Select one option from the list
___

Create a free account to access the full topic