⌘K
Flycodx

Railway Seat Availability Counter

Railway Seat Availability Counter

EasyArrays100% accepted

At IRCTC in Mumbai, Arjun checks seat availability on a Delhi express train. He has an array where 1 means seat is booked and 0 means empty. Count the empty seats.

Approach

Given an array of seat statuses (1=booked, 0=empty), count the number of empty seats.

Input

5 0 1 0 0 0 1 0 1 0 0 0 1 1 1

Output

8
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