Company: Deutsche bank_3nov
Difficulty: medium
Gym Membership Cards Problem Description A gym membership card allows entry for a one-week period that always begins on a Monday and ends on the following Sunday. Ellis attends the gym once a day at most. You are given a list visits of length N, which represents the days Ellis visits the gym, in chronological order. What is the minimum number of gym membership cards that Ellis has to purchase? Write a function: int solution(vector<string> &visits); that, given a list visits of length N, returns the minimum number of gym membership cards that Ellis must purchase based on the order of visits specified. Days of the week in visits are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Examples Example 1: Input: visits = ["Tue", "Sat", "Mon", "Fri"] Output: 2 Explanation: In the first week, Ellis visits the gym on Tuesday and Saturday. In the second week, Ellis visits the gym on Monday and Friday. Example 2: Input: visits = ["Mon", "Mon", "Mon"]