Question
During the assembly, a teacher lines up N students in a line in front of her. She can see the first student and all the
During the assembly, a teacher lines up N students in a line in front of her. She can see the first student and all the students taller than the students before them ( i.e a teacher can see the student i if hi>hj> for all j ,ji ). How many students will the teacher be able to see? WRITE A PROGRAM IN C LANGUAGE.
input Format
The first line will have 1 integer N.
The second line will contain the heights of the students which would be integers in the order of them getting farther from the teacher. (will be separated by a space)
Output Format
Output a single integer which is the amount of students the teacher will be able to see.
Constraints
1N10^5
2hi10^9
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started