4d2d19f136
Write a function that returns the maximum profit that a trader could have made in a day. I solved this using a greedy algorithm which constantly sets the maximum profit by tracking the lowest price we've encountered.
77 lines
2.2 KiB
Org Mode
77 lines
2.2 KiB
Org Mode
* Array and string manipulation
|
|
** DONE Merging Meeting Times
|
|
** DONE Reverse String in Place
|
|
** DONE Reverse Words
|
|
** DONE Merge Sorted Arrays
|
|
** DONE Cafe Order Checker
|
|
* Hashing and hash tables
|
|
** DONE Inflight Entertainment
|
|
** DONE Permutation Palindrome
|
|
** DONE Word Cloud Data
|
|
** DONE Top Scores
|
|
* Greedy Algorithms
|
|
** DONE Apple Stocks
|
|
** TODO Highest Product of 3
|
|
** TODO Product of All Other Numbers
|
|
** TODO Cafe Order Checker
|
|
** TODO In-Place Shuffle
|
|
* Sorting, searching, and logarithms
|
|
** TODO Find Rotation Point
|
|
** TODO Find Repeat, Space Edition
|
|
** TODO Top Scores
|
|
** TODO Merging Meeting Times
|
|
* Trees and graphs
|
|
** TODO Balanced Binary Tree
|
|
** TODO Binary Search Tree Checker
|
|
** TODO 2nd Largest Item in a Binary Search Tree
|
|
** TODO Graph Coloring
|
|
** TODO MeshMessage
|
|
** TODO Find Repeat, Space Edition BEAST MODE
|
|
* Dynamic programming and recursion
|
|
** TODO Recursive String Permutations
|
|
** TODO Compute nth Fibonacci Number
|
|
** TODO Making Change
|
|
** TODO The Cake Thief
|
|
** TODO Balanced Binary Tree
|
|
** TODO Binary Search Tree Checker
|
|
** TODO 2nd Largest Item in a Binary Search Tree
|
|
* Queues and stacks
|
|
** TODO Largest Stack
|
|
** TODO Implement A Queue With Two Stacks
|
|
** TODO Parenthesis Matching
|
|
** TODO Bracket Validator
|
|
* Linked lists
|
|
** DONE Delete Node
|
|
** TODO Does This Linked List Have A Cycle?
|
|
** TODO Reverse A Linked List
|
|
** TODO Kth to Last Node in a Singly-Linked List
|
|
** TODO Find Repeat, Space Edition BEAST MODE
|
|
* System design
|
|
** TODO URL Shortener
|
|
** TODO MillionGazillion
|
|
** TODO Find Duplicate Files
|
|
* General programming
|
|
** TODO Rectangular Love
|
|
** TODO Temperature Tracker
|
|
* Bit manipulation
|
|
** TODO Binary Numbers
|
|
** TODO The Stolen Breakfast Drone
|
|
* Combinatorics, probability, and other math
|
|
** TODO Which Appears Twice
|
|
** TODO Find in Ordered Set
|
|
** TODO In-Place Shuffle
|
|
** TODO Simulate 5-sided die
|
|
** TODO Simulate 7-sided die
|
|
** TODO Two Egg Problem
|
|
* JavaScript
|
|
** TODO JavaScript Scope
|
|
** TODO What's Wrong with This JavaScript?
|
|
* Coding interview tips
|
|
** TODO How The Coding Interview Works
|
|
** TODO General Coding Interview Advice
|
|
** TODO Impostor Syndrome
|
|
** TODO Why You Hit Dead Ends
|
|
** TODO Tips for Getting Unstuck
|
|
** TODO The 24 Hours Before Your Interview
|
|
** TODO Beating Behavioral Questions
|
|
** TODO Managing Your Interview Timeline
|