← 返回 meta 的题目列表Maximize Consecutive Holidays with PTO
类型:online_judge
meta
Given a calendar array containing H and W, where W represents workdays and H represents holidays, and an integer PTO representing paid time off days you can use to convert workdays to holidays. Compute the longest possible consecutive holidays.
Example 1:
Input: calendar = [H, W, W, H, H], PTO = 1
Output: 3
Example 2:
Input: calendar = [H, W, W, W, H], PTO = 2
Output: 3.
Example
Input
H W W H H
1