Back to the past

Report a typo

Correct the import so that the code will compile and work.

Sample Input 1:

2022-12
1

Sample Output 1:

2021-12
Write a program in Scala 3
import java.time.{YearMonth as _, *}

def parseAndDecreaseDate(date: String, yearsToSubstract: Long): YearMonth =
YearMonth.parse(date).minusYears(yearsToSubstract)
___

Create a free account to access the full topic