{"id":16759759,"url":"https://github.com/avikumar15/cp-algorithm-solutions","last_synced_at":"2025-03-16T08:40:34.159Z","repository":{"id":120150959,"uuid":"324221414","full_name":"avikumar15/cp-algorithm-solutions","owner":"avikumar15","description":"Solutions to cp and algorithm problems from platforms like Leetcode, Spoj, Google Contests 👨‍💻","archived":false,"fork":false,"pushed_at":"2021-08-01T20:01:01.000Z","size":75,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T20:51:41.039Z","etag":null,"topics":["algorithms","cpp","cpp17","data-structure","dsa-algorithm","interview-preparation","interview-questions","leetcode","leetcode-cpp","leetcode-solutions","python","spoj","spoj-solutions"],"latest_commit_sha":null,"homepage":"","language":"C++","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/avikumar15.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":"2020-12-24T19:13:28.000Z","updated_at":"2022-08-22T06:03:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"cffa5269-dcac-44ef-ab3f-9845268358f9","html_url":"https://github.com/avikumar15/cp-algorithm-solutions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avikumar15%2Fcp-algorithm-solutions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avikumar15%2Fcp-algorithm-solutions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avikumar15%2Fcp-algorithm-solutions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avikumar15%2Fcp-algorithm-solutions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avikumar15","download_url":"https://codeload.github.com/avikumar15/cp-algorithm-solutions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846986,"owners_count":20357297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["algorithms","cpp","cpp17","data-structure","dsa-algorithm","interview-preparation","interview-questions","leetcode","leetcode-cpp","leetcode-solutions","python","spoj","spoj-solutions"],"created_at":"2024-10-13T04:09:00.287Z","updated_at":"2025-03-16T08:40:34.138Z","avatar_url":"https://github.com/avikumar15.png","language":"C++","readme":"CP \u0026 Algorithm Solutions\n========\nThis repository contains code of cp and algorithmic problems from online coding problems\n\n### LeetCode Algorithms\n\n| # | Title | Solution | Difficulty | Topic |\n|---| ----- | -------- | ---------- | ----- |\n|1|[SpiralTraversal](https://leetcode.com/problems/spiral-matrix/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/SpiralTraversal.cpp)|cpp|Medium\n|2|[VerifySuduko](https://leetcode.com/problems/valid-sudoku/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/VerifySuduko.cpp)|cpp|Medium\n|3|[Set0](https://leetcode.com/problems/set-matrix-zeroes/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/Set0.cpp)|cpp|Medium\n|4|[Rotate90](https://leetcode.com/problems/rotate-image/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/Rotate90.cpp)|cpp|Medium\n|5|[ZigZag](https://leetcode.com/problems/zigzag-conversion/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/ZigZag.cpp)|cpp|Medium\n|6|[GameOfDeath](https://leetcode.com/problems/game-of-life/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/GameOfDeath.cpp)|cpp|Medium\n|7|[BinarySearch2D](https://leetcode.com/problems/search-a-2d-matrix/) | [C++](./algorithms/leetcode/cpp/Medium/Matrix/BinarySearch2D.cpp)|cpp|Medium\n|8|[kClosestPoints](https://leetcode.com/problems/k-closest-points-to-origin/) | [C++](./algorithms/leetcode/cpp/Medium/Heap/kClosestPoints.cpp)|cpp|Medium\n|9|[TopKFrequency](https://leetcode.com/problems/top-k-frequent-elements/) | [C++](./algorithms/leetcode/cpp/Medium/Heap/TopKFrequency.cpp)|cpp|Medium\n|10|[IntervalIntersection](https://leetcode.com/problems/interval-list-intersections/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/IntervalIntersection.cpp)|cpp|Medium\n|11|[JumpGame](https://leetcode.com/problems/jump-game/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/JumpGame.cpp)|cpp|Medium\n|12|[SortColours](https://leetcode.com/problems/sort-colors/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/SortColours.cpp)|cpp|Medium\n|13|[Permutations](https://leetcode.com/problems/permutations/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/Permutations.cpp)|cpp|Medium\n|14|[3SumClosest](https://leetcode.com/problems/3sum-closest/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/3SumClosest.cpp)|cpp|Medium\n|15|[InplaceDuplicate](https://leetcode.com/problems/find-the-duplicate-number/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/InplaceDuplicate.cpp)|cpp|Medium\n|16|[InsertInterval](https://leetcode.com/problems/insert-interval/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/InsertInterval.cpp)|cpp|Medium\n|17|[RotateArray](https://leetcode.com/problems/rotate-array/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/RotateArray.cpp)|cpp|Medium\n|18|[Kadane](https://leetcode.com/problems/maximum-subarray/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/Kadane.cpp)|cpp|Medium\n|19|[MaxIncreaseSameSkyline](https://leetcode.com/problems/max-increase-to-keep-city-skyline/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/MaxIncreaseSameSkyline.cpp)|cpp|Medium\n|20|[3Sum](https://leetcode.com/problems/3sum/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/3Sum.cpp)|cpp|Medium\n|21|[MergeIntervals](https://leetcode.com/problems/merge-intervals/) | [C++](./algorithms/leetcode/cpp/Medium/Arrays/MergeIntervals.cpp)|cpp|Medium\n|22|[SwapPairNodes](https://leetcode.com/problems/swap-nodes-in-pairs/) | [C++](./algorithms/leetcode/cpp/Medium/LinkedList/SwapPairNodes.cpp)|cpp|Medium\n|23|[AddLinkedList](https://leetcode.com/problems/add-two-numbers/) | [C++](./algorithms/leetcode/cpp/Medium/LinkedList/AddLinkedList.cpp)|cpp|Medium\n|24|[RemoveNthNodeAlone](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [C++](./algorithms/leetcode/cpp/Medium/LinkedList/RemoveNthNodeAlone.cpp)|cpp|Medium\n|25|[KthSmallestInBST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) | [C++](./algorithms/leetcode/cpp/Medium/Trees/KthSmallestInBST.cpp)|cpp|Medium\n|26|[NaryPreorder](https://leetcode.com/problems/n-ary-tree-preorder-traversal/submissions/) | [C++](./algorithms/leetcode/cpp/Medium/Trees/NaryPreorder.cpp)|cpp|Medium\n|27|[IsValidBST](https://leetcode.com/problems/validate-binary-search-tree/) | [C++](./algorithms/leetcode/cpp/Medium/Trees/IsValidBST.cpp)|cpp|Medium\n|28|[ClonedTreeCorrespondingNode](https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/) | [C++](./algorithms/leetcode/cpp/Medium/Trees/ClonedTreeCorrespondingNode.cpp)|cpp|Medium\n|29|[BalancedParanthesesScore](https://leetcode.com/problems/score-of-parentheses/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/BalancedParanthesesScore.cpp)|cpp|Medium\n|30|[GroupAnagrams](https://leetcode.com/problems/group-anagrams/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/GroupAnagrams.cpp)|cpp|Medium\n|31|[CountAndSay](https://leetcode.com/problems/count-and-say/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/CountAndSay.cpp)|cpp|Medium\n|32|[MinRemoveToMakeValidParantheses](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/MinRemoveToMakeValidParantheses.cpp)|cpp|Medium\n|33|[LongestSubstringDistinctChar](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/LongestSubstringDistinctChar.cpp)|cpp|Medium\n|34|[PossibleAnagramsPosition](https://leetcode.com/problems/find-all-anagrams-in-a-string/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/PossibleAnagramsPosition.cpp)|cpp|Medium\n|35|[GenerateParantheses](https://leetcode.com/problems/generate-parentheses/) | [C++](./algorithms/leetcode/cpp/Medium/Strings/GenerateParantheses.cpp)|cpp|Medium\n|36|[CPUScheduler](https://leetcode.com/problems/task-scheduler/) | [C++](./algorithms/leetcode/cpp/Medium/Brute_Implementation/CPUScheduler.cpp)|cpp|Medium\n|37|[FindingFirstAndLastPosition](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) | [C++](./algorithms/leetcode/cpp/Medium/Binary_Search/FindingFirstAndLastPosition.cpp)|cpp|Medium\n|38|[SearchInRotatedArray](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [C++](./algorithms/leetcode/cpp/Medium/Binary_Search/SearchInRotatedArray.cpp)|cpp|Medium\n|39|[MinimumPathSum](https://leetcode.com/problems/minimum-path-sum/) | [C++](./algorithms/leetcode/cpp/Medium/Dynamic_Programming/MinimumPathSum.cpp)|cpp|Medium\n|40|[EqualSubsetProblem](https://leetcode.com/problems/partition-equal-subset-sum/submissions/) | [C++](./algorithms/leetcode/cpp/Medium/Dynamic_Programming/EqualSubsetProblem.cpp)|cpp|Medium\n|41|[UniquePath](https://leetcode.com/problems/unique-paths/) | [C++](./algorithms/leetcode/cpp/Medium/Dynamic_Programming/UniquePath.cpp)|cpp|Medium\n|42|[CombinationSum](https://leetcode.com/problems/combination-sum/submissions/) | [C++](./algorithms/leetcode/cpp/Medium/Maths/CombinationSum.cpp)|cpp|Medium\n|43|[ProductVector](https://leetcode.com/problems/product-of-array-except-self/) | [C++](./algorithms/leetcode/cpp/Medium/Maths/ProductVector.cpp)|cpp|Medium\n|44|[NextPermutation](https://leetcode.com/problems/next-permutation/) | [C++](./algorithms/leetcode/cpp/Medium/Maths/NextPermutation.cpp)|cpp|Medium\n|45|[IntToRoman](https://leetcode.com/problems/integer-to-roman/) | [C++](./algorithms/leetcode/cpp/Medium/Maths/IntToRoman.cpp)|cpp|Medium\n|46|[RomanToInt](https://leetcode.com/problems/roman-to-integer/) | [C++](./algorithms/leetcode/cpp/Medium/Maths/RomanToInt.cpp)|cpp|Medium\n|47|[XPowerN](https://leetcode.com/problems/powx-n/) | [C++](./algorithms/leetcode/cpp/Medium/Maths/XPowerN.cpp)|cpp|Medium\n|48|[PhoneBook](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [C++](./algorithms/leetcode/cpp/Medium/Backtracking/PhoneBook.cpp)|cpp|Medium\n|49|[CoursePrerequisites](https://leetcode.com/problems/course-schedule/) | [C++](./algorithms/leetcode/cpp/Medium/Graphs/CoursePrerequisites.cpp)|cpp|Medium\n|50|[CloneGraph](https://leetcode.com/problems/clone-graph/) | [C++](./algorithms/leetcode/cpp/Medium/Graphs/CloneGraph.cpp)|cpp|Medium\n|51|[EquationSolve](https://leetcode.com/problems/evaluate-division/) | [C++](./algorithms/leetcode/cpp/Medium/Graphs/EquationSolve.cpp)|cpp|Medium\n|52|[ShortestBridgeBetweenIslands](https://leetcode.com/problems/shortest-bridge/) | [C++](./algorithms/leetcode/cpp/Medium/Graphs/ShortestBridgeBetweenIslands.cpp)|cpp|Medium\n|53|[TrappingRain](https://leetcode.com/problems/trapping-rain-water/) | [C++](./algorithms/leetcode/cpp/Hard/Arrays/TrappingRain.cpp)|cpp|Hard\n|54|[Median](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [C++](./algorithms/leetcode/cpp/Hard/Arrays/Median.cpp)|cpp|Hard\n|55|[AlienDictionary](https://practice.geeksforgeeks.org/problems/alien-dictionary/1) | [C++](./algorithms/leetcode/cpp/Hard/String/AlienDictionary.cpp)|cpp|Hard\n|56|[MinimumWindowSubstring](https://leetcode.com/problems/minimum-window-substring/) | [C++](./algorithms/leetcode/cpp/Hard/String/MinimumWindowSubstring.cpp)|cpp|Hard\n|57|[Plus1](https://leetcode.com/problems/plus-one/) | [C++](./algorithms/leetcode/cpp/Easy/Arrays/Plus1.cpp)|cpp|Easy\n|58|[RemoveDuplicateInplace](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [C++](./algorithms/leetcode/cpp/Easy/Arrays/RemoveDuplicateInplace.cpp)|cpp|Easy\n|59|[MergeSortedList](https://leetcode.com/problems/merge-two-sorted-lists/) | [C++](./algorithms/leetcode/cpp/Easy/LinkedList/MergeSortedList.cpp)|cpp|Easy\n|60|[RangeSumBST](https://leetcode.com/problems/range-sum-of-bst/) | [C++](./algorithms/leetcode/cpp/Easy/Trees/RangeSumBST.cpp)|cpp|Easy\n|61|[AddBinary](https://leetcode.com/problems/add-binary/) | [C++](./algorithms/leetcode/cpp/Easy/Maths/AddBinary.cpp)|cpp|Easy\n|62|[DecimalToHexadecimal](https://leetcode.com/problems/convert-a-number-to-hexadecimal/) | [C++](./algorithms/leetcode/cpp/Easy/Maths/DecimalToHexadecimal.cpp)|cpp|Easy\n|63|[VerifyAlienDictionary](https://leetcode.com/problems/verifying-an-alien-dictionary/) | [C++](./algorithms/leetcode/cpp/Easy/String/VerifyAlienDictionary.cpp)|cpp|Easy\n|64|[ValidPalindrome](https://leetcode.com/problems/valid-palindrome-ii/) | [C++](./algorithms/leetcode/cpp/Easy/String/ValidPalindrome.cpp)|cpp|Easy\n|65|[LongestCommonPrefix](https://leetcode.com/problems/longest-common-prefix/) | [C++](./algorithms/leetcode/cpp/Easy/String/LongestCommonPrefix.cpp)|cpp|Easy\n\n\n### Google Contest Solutions\n\n| # | Contest Name | Title | Solution |\n|---| ----- | -------- | ---------- |\n|1|Codejam|[ReverseSort](https://codingcompetitions.withgoogle.com/codejam/round/000000000043580a/00000000006d0a5c) | [C++](./algorithms/google/Codejam/QualificationRound21/ReverseSort.cpp)\n|2|Codejam|[CJGreedy](https://codingcompetitions.withgoogle.com/codejam/round/000000000043580a/00000000006d1145) | [C++](./algorithms/google/Codejam/QualificationRound21/CJGreedy.cpp)\n|3|Codejam|[ReverseSortEngineering](https://codingcompetitions.withgoogle.com/codejam/round/000000000043580a/00000000006d12d7) | [C++](./algorithms/google/Codejam/QualificationRound21/ReverseSortEngineering.cpp)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favikumar15%2Fcp-algorithm-solutions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favikumar15%2Fcp-algorithm-solutions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favikumar15%2Fcp-algorithm-solutions/lists"}