⌘K
Flycodx

Fishing Vessel Boundary Violation Check

Fishing Vessel Boundary Violation Check

EasyArrays100% accepted

Vikram monitors Indian territorial waters for the Coast Guard. He tracks N fishing vessel X-coordinates throughout a day. Vessels must stay within territorial limit (0 to 100 km). He needs to check if any vessel violated boundaries and at which position it happened first.

Approach

Given array of N X-coordinates (in km), find the first index where coordinate exceeds limit [0,100], return -1 if all valid.

Input

6 20 45 80 95 105 50

Output

4
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