Showing 3 questions
The count-and-say sequence is generated iteratively. Given a starting number, compute the next number in the sequence by describing the previous one.
#1. Count and Say
You're given a list of flight tickets, each representing a departure and arrival airport. Reconstruct the itinerary by visiting all the airports in the lexicographically smallest order, starting from "JFK".
#2. Reconstruct Itinerary
You are given a list of transactions between people. Determine the minimum number of transactions needed to settle all debts, such that everyone owes or is owed exactly zero.
#3. Optimal Account Balancing