Write a Python solution for the following problem.
Write a Python solution for the following problem.: a task in TaskCompendium spike examples (Harbor dataset). Polycarp has $n$ different binary words. A word called binary if it contains only characters '0' and '1'. For example, these words are binary: "0001", "11", "0" and "0011100".
Part of open-athena/taskcompendium-spike.