Thanks to visit codestin.com
Credit goes to github.com

Skip to content

help2opensource/leetcode-scala-3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Scala-3 main status codecov

Solutions of selected LeetCode problems in Scala 3.

Goal

  • Learn Scala 3 :)
  • Practise Algorithm :)

Code

  • try to be compact and readable at the same time
  • try Scala 3 syntax and features but less Scala specific libraries

Solutions

Topic Problem List
Hashmap
  • 1. Two Sum
  • 387. First unique character in a string
  • 202. Happy Number
  • 380. Insert Delete GetRandom O(1)
  • 205. Isomorphic Strings
  • 299. Bulls and Cows
  • 554. Brick Wall
LinkedList
  • 2. Add Two Numbers
  • 61. Rotate List
  • 19. Remove Nth Node From End of List
  • 206. Reverse Linked List
  • 83. Remove Duplicates from Sorted List
  • 82. Remove Duplicates from Sorted List II
  • 86. Partition List
  • 143. Reorder List
  • 160. Intersection of Two Linked Lists
Two Pointers
  • 3. Longest Substring Without Repeating Characters
  • 11. Container With Most Water
  • 16. 3Sum Closest
  • 209. Minimum Size Sub array Sum
  • 42. Trapping Rain Water
  • 15. 3Sum
  • 28. Implement strStr()
  • 75. Sort Colors
  • 80. Remove Duplicates from Sorted Array II
  • 167. Two Sum II
  • 159. Longest Substring with At Most Two Distinct Characters
  • 228. Summary Ranges
Fast Slow Pointers
  • 141. Linked List Cycle
  • 876. Middle of the Linked List
  • 142. Linked List Cycle II
  • 219. Contains Duplicate II
  • 220. Contains Duplicate III
String
  • 6. ZigZag Conversion
  • 14. Longest Common Prefix
  • 763. Partition Labels
  • 161. One Edit Distance
  • 165. Compare Version Numbers
  • 30. Substring with Concatenation of All Words
  • 76. Minimum Window Substring
  • 415. Add Strings
  • 67. Add Binary
Tries
  • 208. Implement Tries
  • 139. Word Break
  • 140. Word Break 2
  • 212. Word Search 2
  • 1065. Index Pairs of a String
Number
  • 7. Reverse Integer
  • 9. Palindrome Number
  • 43. Multiply Strings
Counting
  • 169. Majority Element
  • 229. Majority Element 2
  • 347. Top K Frequent Elements
  • 358. Rearrange String k Distance Apart
  • 383. Ransom Note
Math
  • 12. Integer to Roman
  • 13. Roman to Integer
  • 66. Plus One
  • 50. Pow(x, n)
  • 96. Unique Binary Search Trees
  • 149. Max Points on a Line
  • 166. Fraction to Recurring Decimal
  • 172. Factorial Trailing Zeroes
  • 168. Excel Sheet Column Title
  • 171. Excel Sheet Column Number
Bit
  • 405. Convert a Number to Hexadecimal
  • 29. Divide Two Integers
  • 78. Subsets
  • 89. Gray Code
  • 136. Single Number
  • 137. Single Number 2
  • 187. Repeated DNA
  • 190. Reverse Bits
  • 191. Number of 1 Bits
Array
  • 26. Remove Duplicates from Sorted Array
  • 88. Merge Sorted Array
  • 78. Subsets
  • 945. Minimum Increment to Make Array Unique
  • 121. Best Time to Buy and Sell Stock
  • 125. Valid Palindrome
  • 151. Reverse Words in a String
  • 189. Rotate Array
  • 680. Valid Palindrome II
  • 283. Move Zeroes
Matrix
  • 54. Spiral Matrix
  • 36. Valid Sudoku
  • 37. Sudoku Solver
  • 48. Rotate Image
  • 59. Spiral Matrix II
  • 73. Set Matrix Zero
  • 74. Search a 2D Matrix
Prefix Sum
  • 238. Product of Array Except Self
  • 303. Range Sum Query - Immutable
  • 724. Find Pivot Index
  • 536. Continuous Subarray Sum
Stack
  • 155. Min Stack
  • 20. Valid Parentheses
  • 901. Online Stock Span
  • 581. Shortest Unsorted Continuous Sub array
  • 150. Evaluate Reverse Polish Notation
  • 32. Longest Valid Parentheses
  • 71. Simplify Path
  • 84. Largest Rectangle in Histogram
Queue
  • 225. Implement Stack using Queues
  • 232. Implement Queue Using Stacks
  • 239. Sliding Window Maximum
  • 649. Dota2 Senate
Sort
  • 148. Sort List
  • 49. Group Anagrams
  • 56. Merge Intervals
  • 164. Maximum Gap
Recursion
  • 21. Merge Two Sorted Lists
  • 24. Swap Nodes in Pairs
  • 25. Reverse Nodes in K-Group
  • 60. Permutation Sequence
  • 23. Merge K Sorted List
Tree
  • 144. Binary Tree Preorder Traversal
  • 94. Binary Tree Inorder Traversal
  • 145. Binary Tree Postorder Traversal
  • 102. Binary Tree Level Order Traversal
  • 110. Balanced Binary Tree
  • 101. Symmetric Tree
  • 104. Maximum Depth of Binary Tree
  • 226. Invert Binary Tree
  • 236. Lowest Common Ancestor of a Binary Tree
  • 103. Binary Tree Zigzag Level Order Traversal
  • 111. Minimum Depth of Binary Tree
  • 114. Flatten Binary Tree to Linked List
  • 105. Construct Binary Tree from Preorder and Inorder Traversal
  • 106. Construct Binary Tree from Inorder and Postorder Traversal
DFS
  • 112. Path Sum
  • 116. Populating Next Right Pointers in Each Node
  • 129. Sum Root to Leaf Numbers
  • 156. Binary Tree upside Down
BFS
  • 127. Word Ladder
  • 130. Surrounded Regions
  • 199. Binary Tree Right Side View
Binary Search Tree
  • 98. Validate Binary Search Tree
  • 450. Delete Node in a BST
  • 701. Insert into a Binary Search Tree
  • 100. Same Tree
  • 108. Convert Sorted Array to Binary Search Tree
  • 99. Recover Binary Search Tree
  • 173. Binary Search Tree Iterator
  • 235. Lowest Common Ancestor of a Binary Search Tree
  • 257. Binary Tree Paths
Binary Search
  • 69. Sqrt(x)
  • 34. Find First and Last Position of Element in Sorted Array
  • 33. Search in Rotated Sorted Array
  • 81. Search in Rotated Sorted Array II
  • 153. Find Minimum in Rotated Sorted Array
  • 154. Find Minimum in Rotated Sorted Array II
  • 35. Search Insert Position
  • 278. First Bad Version
  • 4. Median of Two Sorted Arrays
  • 162. Find Peak Element
Heap
  • 506. Relative Ranks
  • 264. Ugly Number II
  • 215. Kth Largest Element in an Array
  • 23. Merge K sorted list
  • 218. The Skyline
Back Tracking
  • 22. Generate Parentheses
  • 40. Combination Sum II
  • 46. Permutations
  • 10. Regular Expression Matching
  • 17. Letter Combinations of a Phone Number
  • 47. Permutations II
Dynamic Programming
  • 70. Climbing Stairs
  • 64. Minimum Path Sum
  • 53. Maximum Subarray
  • 5. Longest Palindromic Substring
  • 174. Dungeon Game

About

Solutions of selected LeetCode problems in Scala 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%