Its just an attempt to connect two blogs of mine and sharing my other hobbies i.e. writing poems, life experiences, travel stories etc. Thanks for reading. Please note that most of the poems are in Kannada language [ https://en.wikipedia.org/wiki/Kannada]. Blog: https://medium.com/@shaila.hegde
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:
Input:A = [
[ 1, 0, 0],
[-1, 0, 3]
]B = [
[ 7, 0, 0 ],
[ 0, 0, 0 ],
[ 0, 0, 1 ]
]Output: | 1 0 0 | | 7 0 0 | | 7 0 0 |
AB = | -1 0 3 | x | 0 0 0 | = | -7 0 3 |
| 0 0 1 |
Trie structure :
*
/ \
c a
/ \ \
a o end
/ \ \
t r w
/ \ \
end end end