⌘K
Flycodx

Border Checkpost Queue Analysis

Border Checkpost Queue Analysis

MediumArrays100% accepted

Agra border checkpost management tracks vehicle processing times. Calculate rolling average processing times to identify bottlenecks and optimize staffing for smooth traffic flow. Rule: return the rolling averages of every window of size w, in order. Integer averages stay integers; otherwise round to 2 decimals. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.

Approach

Given an array of processing times, window size W, and threshold T, find all window positions where average processing time exceeds threshold.

Input

times=[45,55,50,65,70,80,75,55] w=3

Output

[50,56.67,61.67,71.67,75,70]
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3