Added solution for 167 - The Sultan's Successors Problem