Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
serpheroth
algorithm-essentials
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
algorithm-essentials
/
cpp
/
code
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
master
Breadcrumbs
algorithm-essentials
/
cpp
/
code
/
Copy path
Top
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
3sum-closest.cpp
3sum-closest.cpp
3sum.cpp
3sum.cpp
4sum-1.cpp
4sum-1.cpp
4sum-2.cpp
4sum-2.cpp
4sum-3.cpp
4sum-3.cpp
4sum-4.cpp
4sum-4.cpp
add-binary.cpp
add-binary.cpp
add-two-numbers.cpp
add-two-numbers.cpp
anagrams.cpp
anagrams.cpp
atoi.cpp
atoi.cpp
balanced-binary-tree.cpp
balanced-binary-tree.cpp
binary-tree-inorder-traversal-1.cpp
binary-tree-inorder-traversal-1.cpp
binary-tree-inorder-traversal-2.cpp
binary-tree-inorder-traversal-2.cpp
binary-tree-level-order-traversal-1.cpp
binary-tree-level-order-traversal-1.cpp
binary-tree-level-order-traversal-2.cpp
binary-tree-level-order-traversal-2.cpp
binary-tree-maximum-path-sum.cpp
binary-tree-maximum-path-sum.cpp
binary-tree-postorder-traversal-1.cpp
binary-tree-postorder-traversal-1.cpp
binary-tree-postorder-traversal-2.cpp
binary-tree-postorder-traversal-2.cpp
binary-tree-preorder-traversal-1.cpp
binary-tree-preorder-traversal-1.cpp
binary-tree-preorder-traversal-2.cpp
binary-tree-preorder-traversal-2.cpp
binary-tree-tevel-order-traversal-ii-1.cpp
binary-tree-tevel-order-traversal-ii-1.cpp
binary-tree-tevel-order-traversal-ii-2.cpp
binary-tree-tevel-order-traversal-ii-2.cpp
binary-tree-zigzag-level-order-traversal-1.cpp
binary-tree-zigzag-level-order-traversal-1.cpp
binary-tree-zigzag-level-order-traversal-2.cpp
binary-tree-zigzag-level-order-traversal-2.cpp
candy-1.cpp
candy-1.cpp
candy-2.cpp
candy-2.cpp
climbing-stairs-1.cpp
climbing-stairs-1.cpp
climbing-stairs-2.cpp
climbing-stairs-2.cpp
construct-binary-tree-from-inorder-and-postorder-traversal.cpp
construct-binary-tree-from-inorder-and-postorder-traversal.cpp
construct-binary-tree-from-preorder-and-inorder-traversal.cpp
construct-binary-tree-from-preorder-and-inorder-traversal.cpp
convert-sorted-array-to-binary-search-tree.cpp
convert-sorted-array-to-binary-search-tree.cpp
convert-sorted-list-to-binary-search-tree-1.cpp
convert-sorted-list-to-binary-search-tree-1.cpp
convert-sorted-list-to-binary-search-tree-2.cpp
convert-sorted-list-to-binary-search-tree-2.cpp
copy-list-with-random-pointer.cpp
copy-list-with-random-pointer.cpp
count-and-say.cpp
count-and-say.cpp
evaluate-reverse-polish-notation-1.cpp
evaluate-reverse-polish-notation-1.cpp
evaluate-reverse-polish-notation-2.cpp
evaluate-reverse-polish-notation-2.cpp
first-missing-positive.cpp
first-missing-positive.cpp
flatten-binary-tree-to-linked-list-1.cpp
flatten-binary-tree-to-linked-list-1.cpp
flatten-binary-tree-to-linked-list-2.cpp
flatten-binary-tree-to-linked-list-2.cpp
flatten-binary-tree-to-linked-list-3.cpp
flatten-binary-tree-to-linked-list-3.cpp
gas-station.cpp
gas-station.cpp
gray-code-1.cpp
gray-code-1.cpp
gray-code-2.cpp
gray-code-2.cpp
insertion-sort-list.cpp
insertion-sort-list.cpp
integer-to-roman.cpp
integer-to-roman.cpp
largest-rectangle-in-histogram.cpp
largest-rectangle-in-histogram.cpp
length-of-last-word-1.cpp
length-of-last-word-1.cpp
length-of-last-word-2.cpp
length-of-last-word-2.cpp
linked-list-cycle-ii.cpp
linked-list-cycle-ii.cpp
linked-list-cycle.cpp
linked-list-cycle.cpp
longest-common-prefix-1.cpp
longest-common-prefix-1.cpp
longest-common-prefix-2.cpp
longest-common-prefix-2.cpp
longest-consecutive-sequence-1.cpp
longest-consecutive-sequence-1.cpp
longest-consecutive-sequence-2.cpp
longest-consecutive-sequence-2.cpp
longest-palindromic-substring-1.cpp
longest-palindromic-substring-1.cpp
longest-palindromic-substring-2.cpp
longest-palindromic-substring-2.cpp
longest-palindromic-substring-3.cpp
longest-palindromic-substring-3.cpp
longest-valid-parentheses-1.cpp
longest-valid-parentheses-1.cpp
longest-valid-parentheses-2.cpp
longest-valid-parentheses-2.cpp
longest-valid-parentheses-3.cpp
longest-valid-parentheses-3.cpp
lru-cache.cpp
lru-cache.cpp
maximum-depth-of-binary-tree.cpp
maximum-depth-of-binary-tree.cpp
median-of-two-sorted-arrays.cpp
median-of-two-sorted-arrays.cpp
merge-k-sorted-lists.cpp
merge-k-sorted-lists.cpp
merge-two-sorted-arrays.cpp
merge-two-sorted-arrays.cpp
merge-two-sorted-lists.cpp
merge-two-sorted-lists.cpp
minimum-depth-of-binary-tree-1.cpp
minimum-depth-of-binary-tree-1.cpp
minimum-depth-of-binary-tree-2.cpp
minimum-depth-of-binary-tree-2.cpp
next-permutation.cpp
next-permutation.cpp
partition-list.cpp
partition-list.cpp
path-sum-ii.cpp
path-sum-ii.cpp
path-sum.cpp
path-sum.cpp
permutation-sequence-1.cpp
permutation-sequence-1.cpp
permutation-sequence-2.cpp
permutation-sequence-2.cpp
plus-one-1.cpp
plus-one-1.cpp
plus-one-2.cpp
plus-one-2.cpp
populating-next-right-pointers-in-each-node-ii-1.cpp
populating-next-right-pointers-in-each-node-ii-1.cpp
populating-next-right-pointers-in-each-node-ii-2.cpp
populating-next-right-pointers-in-each-node-ii-2.cpp
populating-next-right-pointers-in-each-node.cpp
populating-next-right-pointers-in-each-node.cpp
recover-binary-search-tree.cpp
recover-binary-search-tree.cpp
regular-expression-matching.cpp
regular-expression-matching.cpp
remove-duplicates-from-sorted-array-1.cpp
remove-duplicates-from-sorted-array-1.cpp
remove-duplicates-from-sorted-array-2.cpp
remove-duplicates-from-sorted-array-2.cpp
remove-duplicates-from-sorted-array-3.cpp
remove-duplicates-from-sorted-array-3.cpp
remove-duplicates-from-sorted-array-ii-1.cpp
remove-duplicates-from-sorted-array-ii-1.cpp
remove-duplicates-from-sorted-array-ii-2.cpp
remove-duplicates-from-sorted-array-ii-2.cpp
remove-duplicates-from-sorted-list-1.cpp
remove-duplicates-from-sorted-list-1.cpp
remove-duplicates-from-sorted-list-2.cpp
remove-duplicates-from-sorted-list-2.cpp
remove-duplicates-from-sorted-list-ii-1.cpp
remove-duplicates-from-sorted-list-ii-1.cpp
remove-duplicates-from-sorted-list-ii-2.cpp
remove-duplicates-from-sorted-list-ii-2.cpp
remove-element-1.cpp
remove-element-1.cpp
remove-element-2.cpp
remove-element-2.cpp
remove-nth-node-from-end-of-list.cpp
remove-nth-node-from-end-of-list.cpp
reorder-list.cpp
reorder-list.cpp
reverse-linked-list-ii.cpp
reverse-linked-list-ii.cpp
reverse-nodes-in-k-group-1.cpp
reverse-nodes-in-k-group-1.cpp
reverse-nodes-in-k-group-2.cpp
reverse-nodes-in-k-group-2.cpp
roman-to-integer.cpp
roman-to-integer.cpp
rotate-image-1.cpp
rotate-image-1.cpp
View all files
You can’t perform that action at this time.