Company: Flipkart Grid SDEintern_18july

Difficulty: easy

Problem Statement

Mr. Thomas is a very well-known mathematician. He went to an education fair where he noticed a lot of brilliant students. So, by seeing their talent, he has given them a problem to solve. The problem was: num = P 1 + P 2 + ... + P N where each P i is an integer and will be in the format XYZ , where X should be considered as the base , Y is considered as the power , and Z represents the number of digits to be considered as the power . Concretely, for one operand P : Let Z be the last (rightmost) digit of P . Z is then discarded — it is never part of the base or the power. From the digits that remain, take the rightmost Z digits: those form the power Y . Everything still to the left of them forms the base X . The operand contributes X Y to the sum. For example, given an equation in the form num = 3011 + 1122 , it should be calculated in the form num = 30 1 1 + 1 12 2 = 31 , where the trailing 1 and 2 are ignored. Can you help the students with a program to solve the given problem? Input

More Flipkart Grid SDEintern_18july OA questionsInterview experiences