An open API service indexing awesome lists of open source software.

https://github.com/anishkumar127/data-structures-and-algorithms

Solutions to Arrays, Strings, Lists, Sorting, Stacks, Trees and General DS problems using JAVA.
https://github.com/anishkumar127/data-structures-and-algorithms

algorithms algorithms-and-data-structures codestudio-solutions data data-structures gfg-solutions hackerrank-solutions hacktoberfest hacktoberfest2022 hacktoebrfest-accepted java leetcode leetcode-java leetcode-solution leetcode-solutions notes pdf solutions

Last synced: 2 months ago
JSON representation

Solutions to Arrays, Strings, Lists, Sorting, Stacks, Trees and General DS problems using JAVA.

Awesome Lists containing this project

README

          

# [**Largest rectangular sub-matrix whose sum is 0**](https://www.geeksforgeeks.org/largest-rectangular-sub-matrix-whose-sum-0/)

## prerequisite :-
- 01. Maximum sum rectangle
- largest subarray with 0 sum

```java
import java.util.*;

class GFG {
public static void main (String[] args) {
int a[][] = { { 1, 2, 3, 4 }, { -1, -2, -4, -3 },
{ -7, -9, 7, 9 }, { 7, -2, 0, 10 } };

int row = 4, col = 4;
System.out.println(larRecSumZero(a, row, col));
}

static int larRecSumZero(int arr[][], int n, int m){
int dp[]=new int[m];

int ans=0;
for(int a=0; a si=new HashMap<>();

for(int i=0;i