<p>There are <code>n</code> tasks assigned to you. The task times are represented as an integer array <code>tasks</code> of length <code>n</code>, where the <code>i<sup>th</sup></code> task takes <code>tasks[i]</code> hours to finish. A <strong>work session</strong> is when you work for <strong>at most</strong><code>sessionTime</code> consecutive hours and then take a break.</p>
<p>You should finish the given tasks in a way that satisfies the following conditions:</p>
<ul>
<li>If you start a task in a work session, you must complete it in the <strong>same</strong> work session.</li>
<li>You can start a new task <strong>immediately</strong> after finishing the previous one.</li>
<li>You may complete the tasks in <strong>any order</strong>.</li>
</ul>
<p>Given <code>tasks</code> and <code>sessionTime</code>, return <em>the <strong>minimum</strong> number of <strong>work sessions</strong> needed to finish all the tasks following the conditions above.</em></p>
<p>The tests are generated such that <code>sessionTime</code> is <strong>greater</strong> than or <strong>equal</strong> to the <strong>maximum</strong> element in <code>tasks[i]</code>.</p>