LTM Limited Interview Question

Program on string concatenation logic.