⌘K
Flycodx

Mobile SIM Activation Queue Wait Time

Mobile SIM Activation Queue Wait Time

EasyArrays100% accepted

Vikram manages a Delhi mobile shop for Jio SIM activations. Each customer takes a certain service time. Vikram wants to tell customers their total wait time (including their own activation). Given service times array, find total wait for Kth customer.

Approach

Given array of N service times and customer position K, find cumulative time up to position K.

Input

service_times=[5,10,3,8,2] K=3

Output

18
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