⌘K
Flycodx

Jio Fiber Plan Speed Matcher

Jio Fiber Plan Speed Matcher

MediumBinary Search100% accepted

Priya needs Jio Fiber for 4K video calls in Pune. Available plans: 30Mbps, 75Mbps, 150Mbps, 300Mbps, 500Mbps. Find minimum plan meeting 180Mbps requirement.

Approach

Given sorted array of available speeds and required speed, find minimum speed ≥ requirement.

Input

speeds=[30,75,150,300,500] required=180

Output

300
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