René's URL Explorer Experiment


Title: Add solutions for searching in 2D matrix (LeetCode #74 and #240) by MohakAgrawal25 · Pull Request #6640 · TheAlgorithms/Java · GitHub

Open Graph Title: Add solutions for searching in 2D matrix (LeetCode #74 and #240) by MohakAgrawal25 · Pull Request #6640 · TheAlgorithms/Java

X Title: Add solutions for searching in 2D matrix (LeetCode #74 and #240) by MohakAgrawal25 · Pull Request #6640 · TheAlgorithms/Java

Description: I have read CONTRIBUTING.md. This pull request is all my own work -- I have not plagiarized it. All filenames are in PascalCase. All functions and variable names follow Java naming conventions. All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations. All new code is formatted with clang-format -i --style=file path/to/your/file.java Pull Request Description What does this PR do? Adds implementations for the "Search a 2D Matrix" problem (both variations) commonly found on LeetCode (#74 and #240). These algorithms are added under src/main/java/com/thealgorithms/matrix to provide useful matrix search solutions. Why is this needed? The current matrix directory lacks solutions for these frequently asked interview problems. Adding them will help learners and contributors understand efficient ways to search in 2D matrices. Changes made: Implemented Search2DMatrix.java containing methods for both matrix search variations. Code follows Java naming conventions and project formatting guidelines. Added relevant LeetCode URLs and explanations in comments for educational purposes. Related Issue: Fixes #6622

Open Graph Description: I have read CONTRIBUTING.md. This pull request is all my own work -- I have not plagiarized it. All filenames are in PascalCase. All functions and variable names follow Java naming conventions. ...

X Description: I have read CONTRIBUTING.md. This pull request is all my own work -- I have not plagiarized it. All filenames are in PascalCase. All functions and variable names follow Java naming conventions. ...

Opengraph URL: https://github.com/TheAlgorithms/Java/pull/6640

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:8b7a1340-f1b3-ea39-9423-570217f5a121
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id937A:309E0A:628164:872125:6A50757A
html-safe-nonce1c8e0686a5e905329fc719e9c9f21879745ac22df77b8755492ed794a491b68b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzdBOjMwOUUwQTo2MjgxNjQ6ODcyMTI1OjZBNTA3NTdBIiwidmlzaXRvcl9pZCI6IjMxMTM0MTg5NDcwOTA3NDA2MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac57b5dd6a2c5aa953bc812259f752a08c765342e4eb3645c387f84501d4386791
hovercard-subject-tagpull_request:2887904973
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/TheAlgorithms/Java/pull/6640/files
twitter:imagehttps://avatars.githubusercontent.com/u/163795673?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/163795673?s=400&v=4
og:image:altI have read CONTRIBUTING.md. This pull request is all my own work -- I have not plagiarized it. All filenames are in PascalCase. All functions and variable names follow Java naming conventions. ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/TheAlgorithms/Java git https://github.com/TheAlgorithms/Java.git
octolytics-dimension-user_id20487725
octolytics-dimension-user_loginTheAlgorithms
octolytics-dimension-repository_id63477660
octolytics-dimension-repository_nwoTheAlgorithms/Java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id63477660
octolytics-dimension-repository_network_root_nwoTheAlgorithms/Java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/TheAlgorithms/Java/pull/6640/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJava%2Fpull%2F6640%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJava%2Fpull%2F6640%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=TheAlgorithms%2FJava
Reloadhttps://github.com/TheAlgorithms/Java/pull/6640/files
Reloadhttps://github.com/TheAlgorithms/Java/pull/6640/files
Reloadhttps://github.com/TheAlgorithms/Java/pull/6640/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/6640/files
TheAlgorithms https://github.com/TheAlgorithms
Javahttps://github.com/TheAlgorithms/Java
Notifications https://github.com/login?return_to=%2FTheAlgorithms%2FJava
Fork 21.2k https://github.com/login?return_to=%2FTheAlgorithms%2FJava
Star 66k https://github.com/login?return_to=%2FTheAlgorithms%2FJava
Code https://github.com/TheAlgorithms/Java
Issues 7 https://github.com/TheAlgorithms/Java/issues
Pull requests 14 https://github.com/TheAlgorithms/Java/pulls
Actions https://github.com/TheAlgorithms/Java/actions
Security and quality 0 https://github.com/TheAlgorithms/Java/security
Insights https://github.com/TheAlgorithms/Java/pulse
Code https://github.com/TheAlgorithms/Java
Issues https://github.com/TheAlgorithms/Java/issues
Pull requests https://github.com/TheAlgorithms/Java/pulls
Actions https://github.com/TheAlgorithms/Java/actions
Security and quality https://github.com/TheAlgorithms/Java/security
Insights https://github.com/TheAlgorithms/Java/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FTheAlgorithms%2FJava%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FTheAlgorithms%2FJava%2Fissues%2Fnew%2Fchoose
MohakAgrawal25https://github.com/MohakAgrawal25
TheAlgorithms:masterhttps://github.com/TheAlgorithms/Java/tree/master
MohakAgrawal25:masterhttps://github.com/MohakAgrawal25/Java/tree/master
Conversation 0 https://github.com/TheAlgorithms/Java/pull/6640
Commits 3 https://github.com/TheAlgorithms/Java/pull/6640/commits
Checks 11 https://github.com/TheAlgorithms/Java/pull/6640/checks
Files changed https://github.com/TheAlgorithms/Java/pull/6640/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/6640/files
Add solutions for searching in 2D matrix (LeetCode #74 and #240) https://github.com/TheAlgorithms/Java/pull/6640/files#top
Show all changes 3 commits https://github.com/TheAlgorithms/Java/pull/6640/files
cf12cf8 add search 2D matrix solutions for both LeetCode variations MohakAgrawal25 Oct 5, 2025 https://github.com/TheAlgorithms/Java/pull/6640/commits/cf12cf81eddcce12758e164cbb51b108654a1549
b1fe8bc Add unit tests for Search2DMatrix implementations MohakAgrawal25 Oct 5, 2025 https://github.com/TheAlgorithms/Java/pull/6640/commits/b1fe8bcd582a77e3de9f1e03a0d012ef7ee53d5e
4b2e5ad Search2DMatrix.java MohakAgrawal25 Oct 5, 2025 https://github.com/TheAlgorithms/Java/pull/6640/commits/4b2e5ad396cbada0a807af33ca8d5e825fa20675
Clear filters https://github.com/TheAlgorithms/Java/pull/6640/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/6640/files
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/6640/files
Search2DMatrix.java https://github.com/TheAlgorithms/Java/pull/6640/files#diff-25891feef9824865e9fbd82e351509637cd4e34b244d7387b06bdafe18ac2fac
Search2DMatrixTest.java https://github.com/TheAlgorithms/Java/pull/6640/files#diff-339fe14f53847a3e727ac9ce0d0f4592cab2ab6e8de3f6b23080a408395fcc8b
https://github.com/TheAlgorithms/Java/blob/master/.github/CODEOWNERS#L1
src/main/java/com/thealgorithms/matrix/Search2DMatrix.javahttps://github.com/TheAlgorithms/Java/pull/6640/files#diff-25891feef9824865e9fbd82e351509637cd4e34b244d7387b06bdafe18ac2fac
View file https://github.com/MohakAgrawal25/Java/blob/4b2e5ad396cbada0a807af33ca8d5e825fa20675/src/main/java/com/thealgorithms/matrix/Search2DMatrix.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/TheAlgorithms/Java/pull/6640/{{ revealButtonHref }}
https://github.com/TheAlgorithms/Java/blob/master/.github/CODEOWNERS#L1
src/test/java/com/thealgorithms/matrix/Search2DMatrixTest.javahttps://github.com/TheAlgorithms/Java/pull/6640/files#diff-339fe14f53847a3e727ac9ce0d0f4592cab2ab6e8de3f6b23080a408395fcc8b
View file https://github.com/MohakAgrawal25/Java/blob/4b2e5ad396cbada0a807af33ca8d5e825fa20675/src/test/java/com/thealgorithms/matrix/Search2DMatrixTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/TheAlgorithms/Java/pull/6640/{{ revealButtonHref }}
Please reload this pagehttps://github.com/TheAlgorithms/Java/pull/6640/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.