Given two sparse matrices A and B, return the result of AB.
You may assume that A’s column number is equal to B’s row number.
Example:
解法1:
只要存下非0的数即可,然后遍历每一对非0的pair,看是否col=row,然后加和到对应的单元格里。
C++
Java
Given two sparse matrices A and B, return the result of AB.
You may assume that A’s column number is equal to B’s row number.
Example:
只要存下非0的数即可,然后遍历每一对非0的pair,看是否col=row,然后加和到对应的单元格里。
C++
Java