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.
2.2 KiB
2.2 KiB
- Array and string manipulation
- Hashing and hash tables
- Greedy Algorithms
- Sorting, searching, and logarithms
- Trees and graphs
- Dynamic programming and recursion
- Queues and stacks
- Linked lists
- System design
- General programming
- Bit manipulation
- Combinatorics, probability, and other math
- JavaScript
- Coding interview tips