there n project number 0 n 1 you give integer array milestone milestonesi denote number milestone ith project hasyou work project follow rulesevery week finish exactly milestone project you work weekyou work milestone project consecutive weeksonce milestone project finish milestone work cause violate rule stop work Note able finish project milestone constraintsreturn maximum number week able work project violating rule mention Example 1input milestone 123output 6explanation one possible scenario during 1st week work milestone project 0 during 2nd week work milestone project 2 during 3rd week work milestone project 1 during 4th week work milestone project 2 during 5th week work milestone project 1 during 6th week work milestone project 2the total number week 6Example 2input milestone 521output 7Explanation one possible scenario during 1st week work milestone project 0 during 2nd week work milestone project 1 during 3rd week work milestone project 0 during 4th week work milestone project 1 during 5th week work milestone project 0 during 6th week work milestone project 2 during 7th week work milestone project 0the total number week 7note work milestone project 0 8th week violate rulesThus milestone project 0 remain unfinished Constraintsn milestoneslength1 n 1051 milestonesi 109