def multiply(self, A, B): cols = [[(j, b) for j, b in enumerate(col) if b] for col in zip(*B)] return [[sum(row[j]*b for j, b in col) for col in cols] for row in A]
@bayesric i have the same doubt
@bayesric I think so too. And I feel that he's done so this way because the test cases are weak and a plain solution suffices to beat the judge.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.