{"id":22513685,"url":"https://github.com/emahtab/maximal-square","last_synced_at":"2026-02-17T21:02:18.266Z","repository":{"id":79525628,"uuid":"249127943","full_name":"eMahtab/maximal-square","owner":"eMahtab","description":"Find the maximal square area","archived":false,"fork":false,"pushed_at":"2020-05-31T07:24:12.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T05:38:39.638Z","etag":null,"topics":["dynamic-programming","leetcode","problem-solving"],"latest_commit_sha":null,"homepage":"","language":null,"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/eMahtab.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-22T06:40:51.000Z","updated_at":"2020-05-31T07:24:14.000Z","dependencies_parsed_at":"2023-05-10T17:16:17.089Z","dependency_job_id":null,"html_url":"https://github.com/eMahtab/maximal-square","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eMahtab/maximal-square","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fmaximal-square","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fmaximal-square/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fmaximal-square/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fmaximal-square/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eMahtab","download_url":"https://codeload.github.com/eMahtab/maximal-square/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eMahtab%2Fmaximal-square/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29558100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T20:52:40.164Z","status":"ssl_error","status_checked_at":"2026-02-17T20:48:10.325Z","response_time":100,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dynamic-programming","leetcode","problem-solving"],"created_at":"2024-12-07T03:14:02.504Z","updated_at":"2026-02-17T21:02:18.261Z","avatar_url":"https://github.com/eMahtab.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maximal Square\n## https://leetcode.com/problems/maximal-square\n\nGiven a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.\n```\nExample:\n\nInput: \n\n1 0 1 0 0\n1 0 1 1 1\n1 1 1 1 1\n1 0 0 1 0\n\nOutput: 4\n```\n# Implementation 1 :\n\n```java\nclass Solution {\n    public int maximalSquare(char[][] matrix) {\n        if(matrix == null || matrix.length == 0)\n            return 0;\n        int maxSquareSize = 0;\n        int rows = matrix.length;\n        int cols = matrix[0].length;\n        \n        int[][] dp = new int[rows + 1][cols + 1];\n        for(int row = 1; row \u003c= rows; row++) {\n            for(int col = 1; col \u003c= cols; col++) {\n                if(matrix[row - 1][col - 1] == '1') {\n                    int min = Math.min(dp[row][col - 1], dp[row - 1][col]);\n                    min = Math.min(min, dp[row - 1][col - 1]);\n                    dp[row][col] = min + 1;\n                    \n                    maxSquareSize = Math.max(maxSquareSize, dp[row][col]);\n                }\n            }\n        }\n       return maxSquareSize * maxSquareSize; \n    }\n}\n```\n\n\n# References :\nhttps://leetcode.com/articles/maximal-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fmaximal-square","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femahtab%2Fmaximal-square","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femahtab%2Fmaximal-square/lists"}