Movie Festival
In a movie festival movies will be shown. You know the starting and ending time of each movie. What is the maximum number of movies you can watch entirely?
Input
The first input line has an integer : the number of movies.
After this, there are lines that describe the movies. Each line has two integers and : the starting and ending times of a movie.
Output
Print one integer: the maximum number of movies.
Constraints
Input:
Output:
Input
The first input line has an integer : the number of movies.
After this, there are lines that describe the movies. Each line has two integers and : the starting and ending times of a movie.
Output
Print one integer: the maximum number of movies.
Constraints
Input:
3
3 5
4 9
5 8
Output:
2
0 Comments
If you have any doubts/suggestion/any query or want to improve this article, you can comment down below and let me know. Will reply to you soon.