Cred | Sde | Homework: Optimal Digit String Concatenation

Cred · Question · Posted Apr 2026

Problem Statement Rohan has been assigned homework to combine n strings of digits and write the result in his notebook. To finish quickly and go play cricket, he wants to find a way to combine these strings such that the final concatenated string is as short as possible. The Rules of Concatenation: Rohan picks the strings one by one in the specific order they are given. Suppose he has already concatenated the first i−1 strings into a single string x ...

The full answer & interview discussion are available to premium members.

Log in Create a free account