⌘K
Flycodx

Income Tax Slab Finder

Income Tax Slab Finder

MediumBinary Search100% accepted

Taxpayer Priya files ITR in India. Income tax uses bracket system: income falls in range [slab_i, slab_i+1]. Binary search quickly determines which slab applies to calculate correct tax rate from government tables.

Approach

Given sorted slab boundaries and tax rates, find applicable rate for given income.

Input

boundaries=[0,250000,500000,1000000,1500000],rates=[0,5,10,20,30],income=750000

Output

10
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