/leetcode

Leetcode Problem Solving

Primary LanguageKotlin

Leetcode

Solution of leetcode problems with Kotlin

86.png

Check my Leetcode Profile : mahadi-init

Instructions

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).

Installation Instruction

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

Code Execution Instruction

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.

Solutions

Easy

  1. Two Sum
  2. Palindrome Number
  3. Best Time to Buy and Sell Stock
  4. Contains Duplicate
  5. Valid Anagram
  6. Fibonacci Number
  7. Reverse Words in a String III
  8. Binary Search
  9. Reverse String
  10. Squares of a Sorted Array
  11. Build Array from Permutation
  12. Concatenation of Array
  13. Final Value of Variable After Performing Operations
  14. Shuffle the Array
  15. Running Sum of 1d Array
  16. Number of Good Pairs
  17. Richest Customer Wealth
  18. Maximum Number of Words Found in Sentences
  19. Difference Between Element Sum and Digit Sum of an Array
  20. Roman to Integer
  21. Detect Capital
  22. Maximum Count of Positive Integer and Negative Integer
  23. Kids With the Greatest Number of Candies
  24. Decode XORed Array
  25. How Many Numbers Are Smaller Than the Current Number
  26. Jewels and Stones
  27. Goal Parser Interpretation
  28. Defanging an IP Address
  29. Convert the Temperature
  30. Smallest Even Multiple
  31. Add Two Integers

Medium

  1. Maximum Ice Cream Bars
  2. Max Increase to Keep City Skyline
  3. Minimum Number of Arrows to Burst Balloons
  4. Minimum Rounds to Complete All Tasks

Contest

  1. Divisible and Non-divisible Sums Difference (Easy)
  2. Minimum Processing Time (medium)
  3. Minimum Sum of Mountain Triplets I

30 Days of Javascript

Javascript / Typescript specific problem solution using Typescript

Instructions

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.

Code Execution Instruction

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

Typescript

  1. Create Hello World Function
  2. Counter
  3. To Be Or Not To Be
  4. Counter II
  5. Apply Transform Over Each Element in Array
  6. Return Length of Arguments Passed
  7. Allow One Function Call
  8. Add Two Promises
  9. Sleep
  10. Array Wrapper