Refactoring WordLadder2 & simple Triangle