Company: eBay MTS 1 - Software Engineer_4july

Difficulty: medium

Problem Statement

Digit Compression Given a digit string number and k, repeatedly split number into groups of k digits from left to right. The last group may be shorter. Replace each group with its digit sum in decimal. Stop when the length is at most k. Input Format The first line contains number. The second line contains k. Output Format Print the final string. Constraints - 2 <= k <= length(number) <= 100000 - number contains decimal digits only.

More eBay MTS 1 - Software Engineer_4july OA questionsInterview experiences