⌘K
Flycodx

Employee Salary Bracket Finder

Employee Salary Bracket Finder

MediumBinary Search0% accepted

HR manager in Delhi maintains salary brackets based on experience. Employees don't match exact years in table - they fall within brackets. Binary search maps experience to correct salary bracket for fair compensation.

Approach

Given sorted experience levels, find salary bracket for employee's years of experience.

Input

exp_levels=[0,2,5,10,15],salaries=[300000,400000,600000,1000000,1500000],years=7

Output

600000
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