Ad
  • Default User Avatar

    The problem has a tag "regex", hence finding a regex solution might be the better solution

  • Default User Avatar
  • Default User Avatar

    I'm wondering...

    days in month are as follow :
    Month lengths from January to December: 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31.

    The test says :
    firstDate = "22/02/2020" k = 1 daysOfTheWeek = ["Saturday"] n = 2
    expected = ["22/02/2020", "29/02/2020"]
    Test.assertDeepEquals(recurringTask(firstDate, k, daysOfTheWeek, n) , expected)
    So how do we find the expected result "29/02/2020" when february is only 28 days?

    I started using Date but got stuck on a verification submission test that used 28 days instead of the real number of days for that year, but then on rerun I got stuck on the test examples ;D
    I'm moving to a new exercize !