Maximum independent test batch

Write codeMedium25 min

Your task

A test runner packs as many suites as it can into one parallel batch. clash_rows gives a square table one row at a time: character j of row i is y when suite i and suite j fight over the same fixture and so cannot run together, and n otherwise. The table is symmetric and every character on its diagonal is n. Return the size of the biggest batch, meaning the largest number of suites that can be chosen so that no chosen suite fights another chosen one. Choosing a single suite is always safe, so the answer is at least 1 once a suite exists. Return 0 when the table is empty. The runner handles at most 26 suites.

Examples

largest_parallel_batch(clash_rows: list[str]) -> int
Example 1
Inputlargest_parallel_batch(["nn", "nn"])
Output2
Example 2
Inputlargest_parallel_batch(["nynn", "ynyn", "nyny", "nnyn"])
Output2
Example 3
Inputlargest_parallel_batch(["nyyyyy", "ynyyyy", "yynyyy", "yyynyy", "yyyyny", "yyyyyn"])
Output1