Skip to main content

Algorithms

General

Patterns

  • Leetcode 101: The 14 Patterns β€’ Vinz Angelo Madrigal πŸ“Ί
    • Leetcode 101 slides β€’ Vinz Angelo Madrigal πŸ“–
    • Make a series that goes through these 14 patterns one at a time?
      • what it is
      • what problems it applies to
      • an example of solving a question with it
      • links to other questions that use the same solution
      • Links to the extra help links at the end of the video
      • Credit to the video creators (and link to the video itself)
      • End series with a 15th post summarizing how to choose the right solution pattern based on the question (with links to each
  • 14 Patterns to Ace Any Coding Interview Question β€’ Fahim ul Haq πŸ“–
  • The Ultimate Strategy to Preparing for the Coding Interview β€’ Arslan Ahmad πŸ“–
  • Leetcode Patterns β€’ Sean Prashad πŸ“–
  • LeetCode Isn’t Real β€’ Memorizing solutions is very different from building problem solving skills; analogy of memorizing the grade school multiplication method vs understanding how it works; memorize a few core algorithms like DFS, BFS and then practice identifying which algorithm applies to each problem you see β€’ NeetCode & The Primagen πŸ“Ί

Strings

Numbers

Arrays

  • πŸ“Ί One Minute Utilities for JavaScript Arrays β€’ 5 minute video by Basarat Ali showing quick functions for checking in an input is an array, checking if two arrays are equal, return the min, max, sum or average value in an array of numbers, joining two arrays, returning the arrays unique items, return an array that inckudes all numbers in a range, and flatten an array of arrays into a single array

Sorting

Searching & Pathfinding

Recursion

Dynamic Programming

Optimizing

FizzBuzz

Given a number, n, for each integer i in the range from 1 to n inclusive, print one value per line as follows:

  • If i is a multiple of both 3 and 5, print FizzBuzz
  • If i is a multiple of 3 (but not 5), print Fizz
  • If i is a multiple of 5 (but not 3), print Buzz
  • If i is not a multiple of 3 or 5, print the value of i
function fizzBuzz(n: number): void {
  for (let i = 1; i <= n; i++) {
    let result: number | 'Fizz' | 'Buzz' | 'FizzBuzz' = i
 
    if (i % 15 === 0) {
        result = 'FizzBuzz'
    } else if (i % 5 === 0) {
        result = 'Buzz'
    } else if (i % 3 === 0) {
        result = 'Fizz'
    }
 
    console.log(result)
  }
}

Inbox