This #264 helps to find the sum of all sub matrices in the given matrix, and this concept is used to find the sum of sub matrix for any given bounds. In this problem, Q queries will be given which gives bounds of the sub matrix. We have to find its sum. Brute force takes O(Q * (N ^ 2)) complexity, but using the method 2 in #264, we can optimise it to a complexity of O(N ^ 2) space and time.
Have you read the Contributing Guidelines on Pull Requests ?
💥 Proposal
This #264 helps to find the sum of all sub matrices in the given matrix, and this concept is used to find the sum of sub matrix for any given bounds. In this problem, Q queries will be given which gives bounds of the sub matrix. We have to find its sum. Brute force takes O(Q * (N ^ 2)) complexity, but using the method 2 in #264, we can optimise it to a complexity of O(N ^ 2) space and time.
Have you read the Contributing Guidelines on Pull Requests ?
Yes