Skip to content

My solutions to LeetCode, ICPC, Hackerrank problems

Notifications You must be signed in to change notification settings

fritzrehde/competitive-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Competitive Programming

This repository contains my solutions to competitive programming problems from various online platforms.

Each of the code solution files contains the problem description, several (differently performing) implementations, as well as time and space complexity analysis.

Table of Contents

# Difficulty Problem Title Implementation
1 Easy Two Sum Python
2 Medium Add Two Numbers Python
3 Medium Longest Substring Without Repeating Characters Python
4 Hard Median Of Two Sorted Arrays Python
5 Medium Longest Palindromic Substring Python
6 Medium Zigzag Conversion Python
7 Medium Reverse Integer Python
8 Medium String To Integer (Atoi) Python
10 Hard Regular Expression Matching Python
11 Medium Container With Most Water Python
13 Easy Roman to Integer Python
14 Easy Longest Common Prefix Python
15 Medium 3Sum Python
17 Medium Letter Combinations of a Phone Number Python
19 Medium Remove Nth Node From End of List Python
20 Easy Valid Parentheses Python
21 Easy Merge Two Sorted Lists Python
22 Medium Generate Parentheses Python
26 Easy Remove Duplicates from Sorted Array Python
28 Easy Find The Index Of The First Occurrence In A String Python
36 Medium Valid Sudoku Python
42 Hard Trapping Rain Water Python
45 Medium Jump Game II Python
49 Medium Group Anagrams Python
50 Medium Pow(X, N) Python
51 Hard N-Queens Python
53 Medium Maximum Subarray Python
54 Medium Spiral Matrix Python
55 Medium Jump Game Python
70 Easy Climbing Stairs Python
94 Easy Binary Tree Inorder Traversal Python
100 Easy Same Tree Python
121 Easy Best Time To Buy And Sell Stock Python
125 Easy Valid Palindrome Python
128 Medium Longest Consecutive Sequence Python
133 Medium Clone Graph Python
136 Easy Single Number Python
144 Easy Binary Tree Preorder Traversal Python
145 Easy Binary Tree Postorder Traversal Python
151 Medium Reverse Words in a String Python
152 Medium Maximum Product Subarray Python
153 Medium Find Minimum in Rotated Sorted Array Python
155 Medium Min Stack Python
167 Medium Two Sum Ii - Input Array Is Sorted Python
179 Medium Largest Number Python
200 Medium Number of Islands Python
206 Easy Reverse Linked List Python
207 Medium Course Schedule Python
210 Medium Course Schedule Ii Python
217 Easy Contains Duplicate Python
225 Easy Implement Stack using Queues Python
226 Easy Invert Binary Tree Python
232 Easy Implement Queue using Stacks Python
238 Medium Product of Array Except Self Python
242 Easy Valid Anagram Python
263 Easy Ugly Number Python
264 Medium Ugly Number II Python
268 Easy Missing Number Python
271 Medium Encode And Decode Strings Python
292 Easy Nim Game Python
300 Medium Longest Increasing Subsequence Python
345 Easy Reverse Vowels of a String Python
370 Medium Range Addition Python
430 Medium Flatten a Multilevel Doubly Linked List Python
443 Medium String Compression Python
450 Medium Delete Node In A Bst Python
476 Easy Number Complement Python
485 Easy Max Consecutive Ones Python
487 Medium Max Consecutive Ones Ii Python
496 Easy Next Greater Element I Python
503 Medium Next Greater Element II Python
557 Easy Reverse Words in a String III Python
572 Easy Subtree of Another Tree Python
633 Medium Sum Of Square Numbers Python
692 Medium Top K Frequent Words Python
701 Medium Insert Into A Binary Search Tree Python
706 Easy Design HashMap Python
735 Medium Asteroid Collision Python
739 Medium Daily Temperatures Python
743 Medium Network Delay Time Python
771 Easy Jewels and Stones Python
874 Medium Walking Robot Simulation Python
945 Medium Minimum Increment To Make Array Unique Python
1052 Medium Grumpy Bookstore Owner Python
1106 Hard Parsing A Boolean Expression Python
1137 Easy N-Th Tribonacci Number Python
1143 Medium Longest Common Subsequence Python
1207 Easy Unique Number of Occurrences Python
1275 Easy Find Winner on a Tic Tac Toe Game Python
1304 Easy Find N Unique Integers Sum up to Zero Python
1431 Easy Kids With the Greatest Number of Candies Python
1443 Medium Minimum Time To Collect All Apples In A Tree Python
1518 Easy Water Bottles Python
1578 Medium Minimum Time to Make Rope Colorful Python
1636 Easy Sort Array By Increasing Frequency Python
1653 Medium Minimum Deletions to Make String Balanced Python
1717 Medium Maximum Score From Removing Substrings Python
1768 Easy Merge Strings Alternately Python
1822 Easy Sign of the Product of an Array Python
1894 Medium Find the Student that Will Replace the Chalk Python
2028 Medium Find Missing Observations Python
2037 Easy Minimum Number Of Moves To Seat Everyone Python
2085 Easy Count Common Words With One Occurrence Python
2259 Easy Remove Digit From Number to Maximize Result Python
3163 Medium String Compression III Python

Array

Difficulty Problem Title Implementation
Easy Arrays - DS Python
Easy Array Left Rotation Python

Linked Lists

Difficulty Problem Title Implementation
Easy Reverse a Linked List Python

Programming Language Choices

Why Python? I think Python is a good language for quickly writing elegant and readable programs. Of course, performance will be compromised, but performance is not the main goal of this project (for now). I am mostly solving these puzzles to improve my knowledge in Algorithms and Data Structures.