Showing 3 questions
You're given daily stock prices. Find the maximum profit you can make by buying and selling the stock once. You must buy before you sell.
#1. Best Time to Buy and Sell Stock
Find all unique triplets in an array that sum to zero. You'll need to consider the potential for duplicate numbers and avoid duplicate triplets in your solution.
#2. 3Sum
Imagine children standing in a circle passing a ball. Given the starting child, the number of children, and a number of passes (seconds), determine which child will have the ball after all the passes are made.
#3. Find the Child Who Has the Ball After K Seconds