Anishluke92 / RubySolution

Problem solving using Ruby programming language
0 stars 1 forks source link

Longest Streak #3

Closed danielpaul closed 3 years ago

danielpaul commented 4 years ago

Create a function that takes an array of date hashes and return the "longest streak" (i.e. longest number of consecutive days in a row).

Example

longest_streak([
  {
    date: "2019-09-18"
  },
  {
    date: "2019-09-19"
  },
  {
    date: "2019-09-20"
  },
  {
    date: "2019-09-26"
  },
  {
    date: "2019-09-27"
  },
  {
    date: "2019-09-30"
  }
]) ➞ 3

Notes