CONCEPTS USED:

Greedy algorithm

DIFFICULTY LEVEL:

Easy.

PROBLEM STATEMENT(SIMPLIFIED):

Arnab is given a number N, he is asked to remove one digit and print the largest possible number.Help Arnab find the number.

See original problem statement here

For Example :

5
1234
2945
9273
3954
19374

234
945
973
954
9374

SOLVING APPROACH:

Since only one digit is to be removed, on referring the fundamentals of data structures in c++, brute force will be a sufficient approach here.

Iterate through the length of the given number(the number of digits is the length) and keep removing digits one by one.

Take the maximum of all the number obtained .

SOLUTIONS:

[TABS_R id=1460]
[forminator_quiz id=”1461″]

Previous post MAXIMIZE FLIP SIGN
Next post REMAINING GOLD COIN

Leave a Reply

Your email address will not be published. Required fields are marked *