Skip to content

Collection of my solutions to coding problems in the Internet with source codes and simplified explanations

License

Notifications You must be signed in to change notification settings

galiarmero/solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧩 solutions

Collection of my solutions to coding problems — with source code and explanation. Currently only solving on LeetCode.

All Solutions

LeetCode

Problem ID Solution Problem Specs
1 Two Sum
2 Add Two Numbers
3 Longest Substring Without Repeating Characters
12 Integer to Roman
13 Roman to Integer
20 Valid Parentheses
23 Merge k Sorted Lists
32 Coin Change
35 Search Insert Position
49 Group Anagrams
55 Jump Game
66 Plus One
69 Sqrt(x)
94 Binary Tree Inorder Traversal
100 Same Tree
101 Symmetric Tree
102 Binary Tree Level Order Traversal
104 Maximum Depth of Binary Tree
108 Convert Sorted Array to Binary Search Tree
110 Balanced Binary Tree
111 Minimum Depth of Binary Tree
121 Best Time to Buy and Sell Stock
122 Best Time to Buy and Sell Stock II
125 Valid Palindrome
144 Binary Tree Preorder Traversal
145 Binary Tree Postorder Traversal
215 Kth Largest Element in an Array
217 Contains Duplicate
238 Product of Array Except Self
242 Valid Anagram
278 First Bad Version
347 Top K Frequent Elements
355 Design Twitter
429 N-ary Tree Level Order Traversal
515 Find Largest Value in Each Tree Row
559 Maximum Depth of N-ary Tree
589 N-ary Tree Preorder Traversal
590 N-ary Tree Postorder Traversal
875 Koko Eating Bananas
1011 Capacity To Ship Packages Within D Days
2331 Evaluate Boolean Binary Tree

GeeksforGeeks

Problem ID Solution Problem Specs
convert-number-to-words Convert a given number to words
minimize-sum-of-an-array-by-at-most-k-reductions Minimize Sum of an Array by at Most K Reductions

CodeChef

Problem ID Solution Problem Specs
BRACKETS Brackets
BROKPHON Broken Telephone
EZSPEAK Easy Pronunciation

Solutions By Category

Array

Platform Problem ID Solution Problem Specs
LeetCode 1 Two Sum
LeetCode 13 Roman to Integer
LeetCode 32 Coin Change
LeetCode 35 Search Insert Position
LeetCode 49 Group Anagrams
LeetCode 55 Jump Game
LeetCode 66 Plus One
LeetCode 121 Best Time to Buy and Sell Stock
LeetCode 122 Best Time to Buy and Sell Stock II
LeetCode 215 Kth Largest Element in an Array
LeetCode 217 Contains Duplicate
LeetCode 238 Product of Array Except Self
LeetCode 242 Valid Anagram
LeetCode 347 Top K Frequent Elements
LeetCode 875 Koko Eating Bananas
LeetCode 1011 Capacity To Ship Packages Within D Days
GeeksforGeeks convert-number-to-words Convert a given number to words
CodeChef BRACKETS Brackets
CodeChef BROKPHON Broken Telephone
CodeChef EZSPEAK Easy Pronunciation

String

Platform Problem ID Solution Problem Specs
LeetCode 3 Longest Substring Without Repeating Characters
LeetCode 12 Integer to Roman
LeetCode 13 Roman to Integer
LeetCode 20 Valid Parentheses
LeetCode 49 Group Anagrams
LeetCode 125 Valid Palindrome
LeetCode 242 Valid Anagram
GeeksforGeeks convert-number-to-words Convert a given number to words
CodeChef BRACKETS Brackets
CodeChef EZSPEAK Easy Pronunciation

Map

Platform Problem ID Solution Problem Specs
LeetCode 1 Two Sum
LeetCode 3 Longest Substring Without Repeating Characters
LeetCode 12 Integer to Roman
LeetCode 13 Roman to Integer
LeetCode 49 Group Anagrams
LeetCode 355 Design Twitter

Set

Platform Problem ID Solution Problem Specs
LeetCode 217 Contains Duplicate

Stack

Platform Problem ID Solution Problem Specs
LeetCode 20 Valid Parentheses
LeetCode 94 Binary Tree Inorder Traversal
LeetCode 101 Symmetric Tree
LeetCode 144 Binary Tree Preorder Traversal
LeetCode 145 Binary Tree Postorder Traversal
LeetCode 589 N-ary Tree Preorder Traversal
LeetCode 590 N-ary Tree Postorder Traversal

Queue

Platform Problem ID Solution Problem Specs
LeetCode 101 Symmetric Tree
LeetCode 102 Binary Tree Level Order Traversal
LeetCode 111 Minimum Depth of Binary Tree
LeetCode 429 N-ary Tree Level Order Traversal

Deque

Platform Problem ID Solution Problem Specs
LeetCode 355 Design Twitter

Linked List

Platform Problem ID Solution Problem Specs
LeetCode 2 Add Two Numbers
LeetCode 23 Merge k Sorted Lists

Priority Queue

Platform Problem ID Solution Problem Specs
LeetCode 23 Merge k Sorted Lists
LeetCode 215 Kth Largest Element in an Array
LeetCode 347 Top K Frequent Elements
LeetCode 355 Design Twitter
GeeksforGeeks minimize-sum-of-an-array-by-at-most-k-reductions Minimize Sum of an Array by at Most K Reductions

Heap

Platform Problem ID Solution Problem Specs
LeetCode 23 Merge k Sorted Lists
LeetCode 215 Kth Largest Element in an Array
LeetCode 347 Top K Frequent Elements
GeeksforGeeks minimize-sum-of-an-array-by-at-most-k-reductions Minimize Sum of an Array by at Most K Reductions

Tree

Platform Problem ID Solution Problem Specs
LeetCode 94 Binary Tree Inorder Traversal
LeetCode 100 Same Tree
LeetCode 101 Symmetric Tree
LeetCode 102 Binary Tree Level Order Traversal
LeetCode 104 Maximum Depth of Binary Tree
LeetCode 108 Convert Sorted Array to Binary Search Tree
LeetCode 110 Balanced Binary Tree
LeetCode 111 Minimum Depth of Binary Tree
LeetCode 144 Binary Tree Preorder Traversal
LeetCode 145 Binary Tree Postorder Traversal
LeetCode 429 N-ary Tree Level Order Traversal
LeetCode 515 Find Largest Value in Each Tree Row
LeetCode 559 Maximum Depth of N-ary Tree
LeetCode 589 N-ary Tree Preorder Traversal
LeetCode 590 N-ary Tree Postorder Traversal
LeetCode 2331 Evaluate Boolean Binary Tree

Binary Tree

Platform Problem ID Solution Problem Specs
LeetCode 94 Binary Tree Inorder Traversal
LeetCode 100 Same Tree
LeetCode 101 Symmetric Tree
LeetCode 102 Binary Tree Level Order Traversal
LeetCode 104 Maximum Depth of Binary Tree
LeetCode 108 Convert Sorted Array to Binary Search Tree
LeetCode 110 Balanced Binary Tree
LeetCode 111 Minimum Depth of Binary Tree
LeetCode 144 Binary Tree Preorder Traversal
LeetCode 145 Binary Tree Postorder Traversal
LeetCode 515 Find Largest Value in Each Tree Row
LeetCode 2331 Evaluate Boolean Binary Tree

Binary Search Tree

Platform Problem ID Solution Problem Specs
LeetCode 108 Convert Sorted Array to Binary Search Tree

Depth-First Search

Platform Problem ID Solution Problem Specs
LeetCode 94 Binary Tree Inorder Traversal
LeetCode 100 Same Tree
LeetCode 101 Symmetric Tree
LeetCode 104 Maximum Depth of Binary Tree
LeetCode 110 Balanced Binary Tree
LeetCode 111 Minimum Depth of Binary Tree
LeetCode 144 Binary Tree Preorder Traversal
LeetCode 145 Binary Tree Postorder Traversal
LeetCode 559 Maximum Depth of N-ary Tree
LeetCode 589 N-ary Tree Preorder Traversal
LeetCode 590 N-ary Tree Postorder Traversal
LeetCode 2331 Evaluate Boolean Binary Tree

Breadth-First Search

Platform Problem ID Solution Problem Specs
LeetCode 101 Symmetric Tree
LeetCode 102 Binary Tree Level Order Traversal
LeetCode 111 Minimum Depth of Binary Tree
LeetCode 429 N-ary Tree Level Order Traversal
LeetCode 515 Find Largest Value in Each Tree Row

Math

Platform Problem ID Solution Problem Specs
LeetCode 2 Add Two Numbers
LeetCode 69 Sqrt(x)

Dynamic Programming

Platform Problem ID Solution Problem Specs
LeetCode 32 Coin Change
LeetCode 55 Jump Game
LeetCode 121 Best Time to Buy and Sell Stock
LeetCode 122 Best Time to Buy and Sell Stock II
LeetCode 238 Product of Array Except Self

Greedy

Platform Problem ID Solution Problem Specs
LeetCode 55 Jump Game

Binary Search

Platform Problem ID Solution Problem Specs
LeetCode 35 Search Insert Position
LeetCode 69 Sqrt(x)
LeetCode 278 First Bad Version
LeetCode 875 Koko Eating Bananas
LeetCode 1011 Capacity To Ship Packages Within D Days

Sort

Platform Problem ID Solution Problem Specs
LeetCode 215 Kth Largest Element in an Array
LeetCode 347 Top K Frequent Elements

About

Collection of my solutions to coding problems in the Internet with source codes and simplified explanations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published