How many days until

Report a typo

The function daysDifference(date1: String, date2: String): Int, where date1 and date2 are ISO 8601 strings representing dates (for example., 2012-07-23), returns the absolute value of the days difference between date1 and date2 (always positive).

Write the correct code for the daysDifference() function.

Sample Input 1:

2000-04-11
1999-09-22

Sample Output 1:

202
Write a program in Kotlin
import kotlinx.datetime.*

fun daysDifference(date1: String, date2: String): Int {
// Write your code here

//
}

fun main() {
val date1 = readLine()!!
val date2 = readLine()!!
println( daysDifference(date1, date2) )
}
___

Create a free account to access the full topic