there n task assign the task time represent integer array task length n ith task take tasksi hour finish a work session work sessiontime consecutive hour breakyou finish give task way satisfie follow conditionsIf start task work session complete work sessionyou start new task immediately finish previous oneyou complete task orderGiven task sessionTime return minimum number work session need finish task follow condition abovethe test generate sessionTime great equal maximum element tasksi Example 1input task 123 sessionTime 3output 2explanation you finish task work session first work session finish second task 1 2 3 hour second work session finish task 3 hoursExample 2input task 31311 sessiontime 8output 2explanation you finish task work session first work session finish task 3 1 3 1 8 hour second work session finish task 1 hourexample 3input task 12345 sessiontime 15output 1explanation you finish task work session Constraintsn taskslength1 n 141 tasksi 10maxtasksi sessiontime 15