Pergunta de entrevista da empresa LinkedIn

Skype coding challenge was text justification. Write a program that takes in a string and line length T as inputs and returns the string in justified form with each line of length T.