134. Gas Station

134. Gas Station There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from the ith station to its next (i + 1)th station. You begin the journey with an empty tank at one of the gas stations. Given two integer arrays gas and cost, return the starting gas station’s index if you can travel around the circuit once in the clockwise direction, otherwise return -1....

<span title='2021-07-24 00:00:00 +0000 UTC'>July 24, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx

621. Task Scheduler

621. Task Scheduler Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. For each unit of time, the CPU could complete either one task or just be idle. However, there is a non-negative integer n that represents the cooldown period between two same tasks (the same letter in the array), that is that there must be at least n units of time between any two same tasks....

<span title='2021-07-24 00:00:00 +0000 UTC'>July 24, 2021</span>&nbsp;·&nbsp;3 min&nbsp;·&nbsp;volyx