LeetCode-Swift
LeetCode-Swift copied to clipboard
Fix `Fatal error: Index out of range` issue when matrix is empty And one typo
The old version of the solution to 304. Range Sum Query 2D - Immutable
didn't cover the case that the input matrix is empty.
When the input matrix is empty, the result will be "Fatal error: Index out of range".

Looks good to me, thanks for the contribution!