{"id":22873329,"url":"https://github.com/ibz-04/maximal-rect","last_synced_at":"2026-07-01T04:31:53.728Z","repository":{"id":233163892,"uuid":"786044417","full_name":"iBz-04/Maximal-rect","owner":"iBz-04","description":"Finding the area of the largest rectangle formed by 1s in a given binary matrix","archived":false,"fork":false,"pushed_at":"2024-11-20T21:35:19.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T12:24:11.555Z","etag":null,"topics":["algorithm-challenges","maximal-rectangle"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iBz-04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-13T08:57:30.000Z","updated_at":"2024-12-04T12:04:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b16cdf64-a37c-44c3-8818-67a1cea8a692","html_url":"https://github.com/iBz-04/Maximal-rect","commit_stats":null,"previous_names":["ibz-04/maximal-rect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iBz-04/Maximal-rect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBz-04%2FMaximal-rect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBz-04%2FMaximal-rect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBz-04%2FMaximal-rect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBz-04%2FMaximal-rect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iBz-04","download_url":"https://codeload.github.com/iBz-04/Maximal-rect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iBz-04%2FMaximal-rect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34993435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm-challenges","maximal-rectangle"],"created_at":"2024-12-13T14:18:34.132Z","updated_at":"2026-07-01T04:31:53.699Z","avatar_url":"https://github.com/iBz-04.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Problem Description\nGiven a binary matrix (matrix), find the area of the largest rectangle formed by 1s. The matrix consists of '0's and '1's.\n\nSolution Approach\nThe solution uses a dynamic programming approach along with a helper function (largestRectangleArea) that computes the largest rectangle area in a histogram.\n\nHelper Function (largestRectangleArea):\n\nThis function treats each row of the matrix as a histogram.\nIt uses a stack-based method to calculate the maximum area of a rectangle that can be formed with the heights of the histogram bars.\n\n\nMain Function (maximalRectangle):\n\nIt initializes a result variable to store the maximum area found.\nIt processes each row of the matrix:\nConverts the row into a histogram (count) representing the heights of bars made of consecutive 1s.\nCalls largestRectangleArea with this histogram to get the largest rectangle area for that row.\nUpdates result with the maximum of the current result and the area obtained from largestRectangleArea.\n\n\nTime Complexity\nThe time complexity of the maximalRectangle function is O(m * n), where m is the number of rows and n is the number of columns in the matrix. This complexity arises from the nested loops iterating through each element of the matrix and then computing the largest rectangle area using largestRectangleArea.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibz-04%2Fmaximal-rect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibz-04%2Fmaximal-rect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibz-04%2Fmaximal-rect/lists"}