Oracle interview question

Word Search ( Backtracking) , SQL on group by