Skip to content

chuchunf/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 with less Scala specific libraries

Solutions

List of Problems by topic and category

  • Solutions are organized into topics, following the same grouping as LeetCode
  • Topics are further divided into categories
  • Solutions in each Topic/Category are ordered by difficulty level
  • Solutions with more explanation are bold
Topic Category Problem List
Hashmap Check existence with O(1)
Discrete key/value container for further processing
Implementation and other usages
OrderedSet Get a key based on predefined order
A compact ordered container
LinkedList Basic operation
Additional operation
Use of linked list
Others
Two Pointers Sliding windows
Two Pointers: same direction
Two Pointers: opposite direction
Fast Slow Pointers
String General Operations
Other Algorithms
Number
Counting
Math Conversion
Calculation
Tricks
Geometry
Bit Operations on Bits
Divide and Mod
Uses of Bit
Array In-place manipulation
Swap or reverse
Others
Matrix Basic operations
In-place operations
Backtracking
Binary Search Basic
Rotated Sorted Array
Two Sorted or Partially Sorted Arrays
Prefix Sum Basic operation 1 way or 2 way
Alternatives and Addons
Stack Implementation
Backtrack previous element
Applications
Monotonic Stack
Queue Implementation
FILO order collection
Monotonic Queue
Sort
Bucket Sort Frequency
Usage of Bucket
Recursion With recursive data structure
Without recursive data structure
Tree Tree Traversals
Other operations
Check Tree properties
Construction and Destruction of Tree
Tries
Binary Search Tree Check BST properties
Modify BST
Construct BST
Traversal of BST
DFS Recursion
Back tracking
BFS
Graph
Union Find
Heap
Back Tracking
Dynamic Programming Count number in array or matrix
Knapsack and coin machine etc
Substring and common string etc
Greedy

List of Problems by Series

  • Problems grouped into series, each series has a common setting but different constraints.
  • Different data structures and algorithms could be used to handle these constraints accordingly.
Series Problem List
My Calendar
Contains Duplicate
Valid Palindrome
Next Greater Element
Course Schedule
Best Time to Buy and Sell Stock

About

LeetCode Solutions in Scala 3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages