FAVMIN - Editorial

PROBLEM LINK:

Practice
Contest

Author: Varun Singh

DIFFICULTY:

CAKEWALK

PREREQUISITES:

None

PROBLEM:

Given the height of N minions, find the height of the tallest minion

QUICK EXPLANATION:

Scan the height of all the minions and find the largest number among them.

EXPLANATION:

For each test case, scan the height of all the minions one by one and keep a record of the largest number. The largest number is the answer.

ALTERNATIVE SOLUTION:

Alternatively, one can store all the numbers in an array, sort them in descending order and print the first element of the array. Although this will take slightly longer than the previous solution but given the input size, it won’t make any noticeable difference.

AUTHOR’S SOLUTIONS:

Author’s solution can be found here.