Showing 3 of 1,718 questions
Find two numbers in a given array that add up to a specific target value, and return their indices. Essentially, you need to efficiently locate the pair that satisfies the sum requirement.
#1. Two Sum
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
Rearrange the characters in a given string such that no two adjacent characters are the same. If such an arrangement is possible, return it; otherwise, return an empty string.
#3. Reorganize String