Longest Words(LintCode 133):

Problem