An elevator is currently at floor start in a building with n floors, numbered from n
You are given an integer n, an integer start, and an integer array requests containing distinct floor numbers that must be visited.
The elevator starts at time start and requires start is present in requests, its penalty is
Return the minimum total penalty required to fulfill all requests in requests.
Constraints:
n
requests.length
start, requests[i] n
All values in requests are distinct.
An elevator is currently at floor start in a building with n floors, numbered from n
You are given an integer n, an integer start, and an integer array requests containing distinct floor numbers that must be visited.
The elevator starts at time start and requires start is present in requests, its penalty is
Return the minimum total penalty required to fulfill all requests in requests.
Constraints:
n
requests.length
start, requests[i] n
All values in requests are distinct.