Тёмный

Sum of all Submatrices 

Rajesh Aatrayan
Подписаться 56
Просмотров 6 тыс.
50% 1

Problem Description
Given a 2D Matrix A of dimensions N*N, we need to return sum of all possible submatrices.
Input Format
Single argument representing a 2-D array A of size N x N.
Output Format
Return an integer denoting the sum of all possible submatrices in the given matrix.
Example Input
A = [ [1, 1]
[1, 1] ]
Example Output
16
Example Explanation
Number of submatrices with 1 elements = 4, so sum of all such submatrices = 4 * 1 = 4
Number of submatrices with 2 elements = 4, so sum of all such submatrices = 4 * 2 = 8
Number of submatrices with 3 elements = 0
Number of submatrices with 4 elements = 1, so sum of such submatrix = 4
Total Sum = 4+8+4 = 16

Опубликовано:

 

20 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 9   
@bkmeher9005
@bkmeher9005 9 месяцев назад
Great explanation sir, thanks
@dummymail5261
@dummymail5261 Год назад
Really helpful. Thanks @Rajesh
@prateekranjanpadhi7399
@prateekranjanpadhi7399 3 года назад
thank you so much mannnn!!!! plz keep posting videos like these...
@ankitsoni3388
@ankitsoni3388 4 года назад
Finally Found a useful Video, Thanks!
@prashanthreddy1718
@prashanthreddy1718 4 года назад
Nicely explained for tackling these kind of tough problems
@bammidisandhyaytpluiitlj4900
@bammidisandhyaytpluiitlj4900 4 года назад
Mind blowing.. Power blasting
@AkankshaPriya7777
@AkankshaPriya7777 3 года назад
wonderful explanation
@jaganryali7687
@jaganryali7687 2 года назад
Like for nice explanation
@Prashantkumar-pn6qq
@Prashantkumar-pn6qq 4 года назад
Nice explanation.
Далее
Борщ в стиле высокой кухни!
00:57
Шоколад приходит на Землю.
00:23
Просмотров 135 тыс.
🎙ПОЮ ВЖИВУЮ!
3:07:23
Просмотров 913 тыс.
Viral Video of a Man's Crazy Job Interview
16:02
Просмотров 1,4 млн
2D Prefix Sum and Submatrix Sum Queries
5:12
Просмотров 6 тыс.
The way math should be taught
14:47
Просмотров 285 тыс.
Range Sum Query 2D - Immutable - Leetcode 304 - Python
13:17
Борщ в стиле высокой кухни!
00:57