Next Month

Report a typo

The function nextMonth(date: String): String takes an ISO 8601 date and time string (e.g., 2022-02-01T22:10:00Z) as a parameter and returns an ISO 8601 date and time string of the following month.

Write the correct code for the nextMonth() function.

Sample Input 1:

2000-12-01T00:00:00Z

Sample Output 1:

2001-01-01T00:00:00Z
Write a program in Kotlin
import kotlinx.datetime.*

fun nextMonth(date: String): String {
// Write your code here

//
}

fun main() {
val date = readln()
println(nextMonth(date))
}
___

Create a free account to access the full topic