Cubic interview question

String manipulation leetcode style questions using Java