/dsa-playground

This repo contains my solutions to some data structures and algorithms problems on leetcode.

Primary LanguageKotlin

DSA Playground

This repository contains solutions to dsa problems in kotlin.


NOTE:

This file will get long, please consider using <Ctrl>F


DSA With Kunal - Assignments

Check the lectures here

Array

# Problem Difficulty Solution
1 Build Array from Permutation Easy Solution
2 Concatenation of Array Easy Solution
3 Running Sum of 1d Array Easy Solution
4 Richest Customer Wealth Easy Solution
5 Shuffle the Array Easy Solution
6 Kids With the Greatest Number of Candies Easy Solution
7 Number of Good Pairs Easy Solution
8 How Many Numbers Are Smaller Than the Current Number Easy Solution
9 Create Target Array in the Given Order Easy SOlution
10 Check if the Sentence Is Pangram Easy Solution
11 Count Items Matching a Rule Easy SOlution
12 Find the Highest Altitude Easy Solution
13 Flipping an Image Easy Solution
14 Cells with Odd Values in a Matrix Easy Solution
15 Matrix Diagonal Sum Easy SOlution
16 Find Numbers with Even Number of Digits Easy Solution
17 Transpose Matrix Easy Solution
18 Add to Array-Form of Integer Easy Solution
19 Maximum Population Year Easy Solution
20 Determine Whether Matrix Can Be Obtained By Rotation Easy Solution
21 Two Sum Easy Solution
22 Find N Unique Integers Sum up to Zero Easy Solution
23 Lucky Number In a Matrix Easy Solution
24 Maximum Subarray Easy Solution
25 Reshape the Matrix Easy Solution
26 Plus One Easy Solution
27 Remove Duplicates from Sorted Array Easy Solution
28 Spiral Matrix Medium Solution
29 Spiral Matrix II Medium Solution
30 Spiral Matrix III Medium Solution
31 Set Matrix Zeroes Medium Solution
32 Product of Array Except Self Medium Solution
33 Find First and Last Position of Element in Sorted Array Medium Solution
34 Jump Game Medium Solution
35 Rotate Array Medium Solution
36 Sort Colors Medium Solution

Searching

# Problem Difficulty Solution
1 Square Root Easy Solution
2 Guess Number Higher or Lower Easy Solution
3 First Bad Version Easy Solution
4 Two Sum II - Input array is sorted Easy Solution
5 Valid Perfect Square Easy Solution
6 Arranging Coins Easy Solution
7 Find Smallest Letter Greater Than Target Easy Solution
8 Kth Missing Positive Number Easy Solution
9 Search Insert Position Easy Solution
10 Peak Index in a Mountain Array Easy Solution
11 Count Negative Numbers in a Sorted Matrix Easy Solution
12 Intersection of Two Arrays Easy Solution
13 Intersection of Two Arrays II Easy Solution
14 Fair Candy Swap Easy Solution
15 Check If N and Its Double Exist Easy Solution
16 Special Array With X Elements Greater Than or Equal X Easy Solution
17 Single Element in a Sorted Array Medium Solution
18 Search in Rotated Sorted Array Medium Solution
19 Search in Rotated Sorted Array II Medium Solution
20 Find Minimum in Rotated Sorted Array Medium Solution
21 Maximum Value at a Given Index in a Bounded Array Medium Solution
22 Koko eating bananas Medium Solution
23 Minimum Absolute Sum Difference Medium Solution
24 Search a 2D Matrix Medium Solution

Sort

# Problem Difficulty Solution
1 Missing Number Easy Solution
2 Find All Numbers Disappeared in an Array Easy Solution
3 Find the Duplicate Number Medium Solution
4 Find All Duplicates in an Array Medium Solution
5 Set Mismatch Medium Solution
6 First Missing Positive Hard Solution
7 Merge Sorted Array Easy Solution
8 Majority Element Easy Solution
9 Contains Duplicate Easy Solution
10 Third Maximum Number Easy Solution
11 Assign Cookies Easy Solution
12 Array Partition I Easy Solution
13 Maximum Product of Three Numbers Easy Solution
14 Sort Array By Parity Easy Solution
15 Sort Array By Parity II Easy Solution
16 Largest Perimeter Triangle Easy Solution
17 Squares of a Sorted Array Easy Solution
18 Matrix Cells in Distance Order Easy Solution
19 Height Checker Easy Solution
20 Relative Sort Array Easy Solution
21 Minimum Absolute Difference Easy Solution
22 Rank Transform of an Array Easy Solution
23 Sort Integers by The Number of 1 Bits Easy Solution
24 How Many Numbers Are Smaller Than the Current Number Easy Solution
25 Maximum Product of Two Elements in an Array Easy Solution
26 Average Salary Excluding the Minimum and Maximum Salary Easy Solution
27 Make Two Arrays Equal by Reversing Sub-arrays Easy Solution
28 Can Make Arithmetic Progression From Sequence Easy Solution
29 Sort Array by Increasing Frequency Easy Solution
30 3 Sum Easy Solution
31 3Sum Closest Easy Solution
32 Group Anagrams Easy Solution
33 Merge Intervals Easy Solution

Random Leetcode

Problem Solution Comments
Median of Two Sorted Arrays Solution
Add Two Numbers Solution Improvement Needed
Split Array Largest Sum Solution