Giter Site home page Giter Site logo

leetcode-scala-3's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.