Code samples from twitch.tv/fhinkel
Video: https://www.youtube.com/watch?v=oZyomw_N70o
Code: max-gap.js
Given an unsorted array of numbers, find the maximum difference between the successive elements in its sorted form. Linear time (and linear space)!
Video: https://www.youtube.com/watch?v=vpOUP4jQqJM
Code: trees.js
- Tree traversals: inorder, preorder, and postorder.
- Given a binary tree in which each node element contains a number. Find the maximum possible sum from one leaf node to nother.
Video: https://www.youtube.com/watch?v=sNvHfgm1yw0&t=9s
Code: substring.js
Given a string s and an array of words, find that longest word that's a substring of s.
Video: https://youtu.be/SiL6GmE0tTc
Random selection of problems:
- Number of Islands, https://leetcode.com/problems/number-of-islands/
- Jewels and Stones, https://leetcode.com/problems/jewels-and-stones/
- Vowel Count, https://www.codewars.com/kata/54ff3102c1bad923760001f3
- Even Fibonacci Numbers, https://projecteuler.net/problem=2
- Sum Square Difference, https://projecteuler.net/problem=6
- 1000-Digit Fibonacci Number, https://projecteuler.net/problem=25
- Counting Sundays, https://projecteuler.net/problem=19