Correct the import so that the code will compile and work.
Imports
Back to the past
Report a typo
Sample Input 1:
2022-12
1Sample Output 1:
2021-12Write a program in Scala 3
import java.time.{YearMonth as _, *}
def parseAndDecreaseDate(date: String, yearsToSubstract: Long): YearMonth =
YearMonth.parse(date).minusYears(yearsToSubstract)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.