Pergunta de entrevista da empresa Mobicip

Given string abc, write algo to find substrings : a,ab,b,ac,.........abc