Graphs
Data Structures
Algorithms
Logic
def estranged_row(m: list) -> int: lens = list(map(len, m)) return next(filter(lambda l: lens.count(l[1]) == 1, enumerate(lens)))[0]
from collections import Counterdef estranged_row(m:list) -> int:estr= Counter([len(a) for a in m]).most_common(1)[0][0]for index,items in enumerate(m):if len(items) != estr:return index- def estranged_row(m: list) -> int:
- lens = list(map(len, m))
- return next(filter(lambda l: lens.count(l[1]) == 1, enumerate(lens)))[0]