Greate solution @stpeterh ! I see when you use normal matrix multiplication, you can't check if B[k][j] != 0 since you don't have the value of k yet. Moving the k loop before the j loop was absolute genius.
How can we describe the Time complexity of this solution in an interview? Thanks!