Coursera interview question

Write a Program to Justify a String based on certain rules.