Showing 2 questions
Determine the fewest swaps needed to transform a binary string into an alternating pattern (0101 or 1010). Count the swaps required to achieve each alternating pattern and return the minimum.
#1. Minimum Number of Swaps to Make the Binary String Alternating
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.
#2. Best Time to Buy and Sell Stock
Page 1 of 1 · 2 total