top of page

Problem 3

Leaders of Elements (Id-1244)

Question:   

         Given a set of 'n' elements in an order, identify all the leaders and print them. An element is said to be a leader if all the elements to its right are smaller than it. For example, if the elements are 12, 13, 16, 7, 10 then there is only one leader element 16. If there are no leaders in the given set of elements then print 'No leaders'.

Input Format:

Number of elements in the given set: 'n'

element-1

element-2

...

element-n

Output Format:

Elements that are leaders. Else, print 'No leaders' when there is no leader.

OUTPUT
INPUT
PROCESSING
C  PROGRAM

I'm a paragraph. Click here to add your own text and edit me. It's easy.

I'm a paragraph. Click here to add your own text and edit me. It's easy.

I'm a paragraph. Click here to add your own text and edit me. It's easy.

I'm a paragraph. Click here to add your own text and edit me. It's easy.

bottom of page