leetle

Daily challenge for 2025-08-11

223. Elevator Efficiency Optimizer

Write a function solve that calculates the most efficient elevator route. Given current floor and a list of requested floors, return the minimum total floors traveled to visit all requests.

Example:
Input: current = 5, requests = [2, 8, 3, 9]
Output: 12 (5→2→3→8→9 travels 3+1+5+1=10 floors)

Run this challenge interactively in Python or JavaScript when the app loads.