Solution of leetcode problems with Kotlin
Check my Leetcode Profile : mahadi-init
There are three categories of problem solutions (Easy, Medium, Hard) and three specific folders for
each category. Every folder has an Interface name Problem
(contains the functions of the problems) and class
name Solution
(implements the interface and solve the problems).
To run kotlin code, JDK(Java Development Kit) is required. To download JDK, visit Oracle Java download page.
Note: For better experience, use IntelliJ Idea IDE
It's possible to run kotlin code from command Line, but it's recommended to IntelliJ Idea for Kotlin Development. IntelliJ Idea have build in Run and Debug functionality.
- Two Sum
- Palindrome Number
- Best Time to Buy and Sell Stock
- Contains Duplicate
- Valid Anagram
- Fibonacci Number
- Reverse Words in a String III
- Binary Search
- Reverse String
- Squares of a Sorted Array
- Build Array from Permutation
- Concatenation of Array
- Final Value of Variable After Performing Operations
- Shuffle the Array
- Running Sum of 1d Array
- Number of Good Pairs
- Richest Customer Wealth
- Maximum Number of Words Found in Sentences
- Difference Between Element Sum and Digit Sum of an Array
- Roman to Integer
- Detect Capital
- Maximum Count of Positive Integer and Negative Integer
- Kids With the Greatest Number of Candies
- Decode XORed Array
- How Many Numbers Are Smaller Than the Current Number
- Jewels and Stones
- Goal Parser Interpretation
- Defanging an IP Address
- Convert the Temperature
- Smallest Even Multiple
- Add Two Integers
- Maximum Ice Cream Bars
- Max Increase to Keep City Skyline
- Minimum Number of Arrows to Burst Balloons
- Minimum Rounds to Complete All Tasks
- Divisible and Non-divisible Sums Difference (Easy)
- Minimum Processing Time (medium)
- Minimum Sum of Mountain Triplets I
Javascript / Typescript specific problem solution using Typescript
Folder structure is same as kotlin but as typescript isn't OOP oriented, Interface and class hasn't used.Instead, the file names are same as problem title.
First install bun globally.
npm i -g bun
To run a file, call the function from main function and run the main function.
bun run main.ts
- Create Hello World Function
- Counter
- To Be Or Not To Be
- Counter II
- Apply Transform Over Each Element in Array
- Return Length of Arguments Passed
- Allow One Function Call
- Add Two Promises
- Sleep
- Array Wrapper