Company: Flipkart - Hirevue

Difficulty: easy

Problem Statement

A class of students is given an equation of the form num = P 1 + P 2 + ... + P N where every operand P i is an integer written in the compressed format XYZ : Z is the last digit of the operand. It is not part of the value — it only tells you how many digits form the power. Y is formed by the Z digits standing immediately to the left of that last digit. It is the power (exponent). X is everything that remains on the left. It is the base . The operand therefore contributes X Y to the sum, and the digit Z is discarded. For example, given the equation num = 3011 + 1122 , it must be evaluated as num = 30 1 + 1 12 = 30 + 1 = 31 , where the trailing 1 of 3011 and the trailing 2 of 1122 are ignored (they only say that the power is 1 digit long and 2 digits long respectively). Can you help the students with a program that evaluates the given equation? Input Format The first line of input contains the integer N , the total number of operands in the equation. Each of the following N lines c

More Flipkart - Hirevue OA questionsInterview experiences