Showing 4 questions
In a group of people, find the "celebrity": someone who is known by everyone else, but doesn't know anyone themselves. You are given a way to query whether two people know each other.
#1. Find the Celebrity
Determine if a given string is a palindrome, considering only alphanumeric characters and ignoring cases. Essentially, check if the string reads the same forwards and backward after removing non-alphanumeric characters and converting to lowercase.
#2. Valid Palindrome
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.
#3. Best Time to Buy and Sell Stock
Maximize your profit by buying and selling a stock multiple times. You're given an array representing stock prices, and can make as many transactions as you want.
#4. Best Time to Buy and Sell Stock II