Calendar Conflicts

Programming Interview Hard 9 views
Back to Questions

Problem Description

You're given {x}. Create Calendar class add(start,end) returns YES if added else NO (conflict if overlap). Output results for each add.

Input Format

First line n. Next n lines start end.

Output Format

n lines YES/NO.

Sample Test Case

Input:
4 1 3 3 5 2 4 6 7
Output:
YES YES NO YES

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next