Problem Description

Input has n and failAt. Simulate opening a resource n times in loop and closing in finally. If i equals failAt, throw. Print final openCount (should be 0).

Input Format

One line: n failAt (1-based, 0 means never fail).

Output Format

One integer openCount.

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next