This repository consists of my solution of algorithm and data structures problems in different online judge platforms i.e LeetCode, Hackerrank, UVA, CodeForces, GFG. 80% of the problems have been solved using Java, rest are C and C++.
Although I solved many more problems in these platforms, I only documented these solutions.
All the problems are categorized by the respective online judge. You can access the problem and the solution directly from the link.
Practice problems from Geek for Geek in Java. All the codes are tested in online-judge. Some problems are not solved yet.
-
Mathematical and Algorithmic Puzzle
-
Easy
- GCD of Array
- Sum of all prime numbers between 1 and N
- Pairs of prime number
- Pair cube count
- Check if given four points form a square
- Perfect Numbers
- Print the Kth Digit
- Closest Number
- Series GP
- Add two fractions
- Find Nth root of M
- Trailing zeroes in factorial
- Triangular Number
- Overlapping rectangles
- Number Of Open Doors
- Angle between hour and minute hand
- Day of the week
- 3 Divisors
- Count Squares
- Nth Even Fibonacci Number
- Squares in a Matrix
-
Medium
-
Contest
-
-
Array
-
Easy
- Rotate Array
- Remove Duplicates from unsorted array
- Find minimum and maximum element in an array
- Minimum distance between two numbers
- Operating an array
- Chocolate Distribution Problem
- Count Smaller elements
- Majority Element
- Sorted subsequence of size 3
- Leaders in an array
- Max sum path in two arrays
- Product array puzzle
- Find duplicates in an array
- Longest Consecutive Subsequence
- Three way partitioning
- Wave Array
- Pair with given sum in a sorted array
-
Medium
- Trapping Rain Water
- Stock buy and sell
- Maximum Sub Array
- Find Missing And Repeating
- Maximum Index
-
Contest
-
-
Backtracking
-
Easy
-
Medium
-
Solved problems from Leetcode using Java. All the codes are tested in online-judge.
# | Title | Tag |
---|---|---|
42 | Trapping Rain Water | Array, Two Pointers, Stack |
224 | Basic Calculator | Math, Stack, String |
Solved problems from Hackerrank using Java. All the codes are tested in online-judge.
Title | Tag |
---|---|
Minimum Absolute Difference in an Array | Array, Greedy |
Luck Balance | Greedy |
Strings: Making Anagrams | String |
Arrays: Left Rotation | Arrays |
Quicksort 1 - Partition | Sorting |
Counting Sort 1 | Sorting |
Counting Sort 2 | Sorting |
Equal Stack | Stack |
Detect a Cycle | Linked List |
Reverse a doubly linked list | Linked List |
Insert a node at a specific position in a linked list | Linked List |
Inserting a Node Into a Sorted Doubly Linked List | Linked List |
Find Merge Point of Two Lists | Linked List |
Print the Elements of a Linked List | Linked List |
Insert a Node at the Tail of a Linked List | Linked List |
Insert a node at the head of a linked list | Linked List |
Delete a Node | Linked List |
Print in Reverse | Linked List |
Reverse a linked list | Linked List |
Merge two sorted linked lists | Linked List |
Get Node Value | Linked List |
Compare two linked lists | Linked List |
Delete duplicate-value nodes from a sorted linked list | Linked List |
Jesse and Cookies | Heap |
QHEAP1 | Heap |
2D Array - DS | Array |
Height of a Binary Tree | Tree |
Title | Tag |
---|---|
Greedy Florist | Greedy |
Max Min | Greedy |
Balanced Brackets | Stack |
Pairs | Search |
The Full Counting Sort | Sorting, String |
Queues: A Tale of Two Stacks | Stack |
Cycle Detection | Linked List |
Sparse Arrays | Arrays |
Sorting: Comparator | Sorting |
Is This a Binary Search Tree? | Trees |
Title | Tag |
---|
Solved problems from UVA using C, C++, Java. All the codes are tested in online-judge.
Solved problems from Codeforces using Java. All the codes are tested in online-judge.
# | Title | Tag |
---|---|---|
1081A | Definite Game | Math |
1084A | The Fair Nut and Elevator | Brute Force |
1084B | Kvass and the Fair Nut | Greedy |
1087A | Right-Left Cipher | String |
1088A | Ehab and another construction problem | Brute Force, Constructive |
1088B | Ehab and subtraction | Sorting |
1092A | Uniform String | String |
1092B | Teams Forming | Sorting |
1093A | Dice Rolling | Math |
1093B | Letters Rearranging | Greedy, Sortings |
1097A | Gennady and a Card Game | Brute Force |
1097B | Petr and a Combination Lock | Bitmasks, Brute Force |
1099A | Snowball | Brute Force |
1102A | Integer Sequence Dividing | Math |