leetle

Daily challenge for 2026-07-30

576. Popular Merchant Threshold

You are given a list of transactions, where each transaction is represented as a list of three elements: [userId, merchant, amount]. You are also given an integer threshold.

Your task is to find the merchant that has the highest number of unique users who have made at least one transaction of amount >= threshold.

If there is a tie between multiple merchants, return the merchant name that is lexicographically smallest. If no merchant has any transactions meeting the threshold, return an empty string "".

Example:
Input: transactions = [["u1", "Amazon", 50], ["u2", "Amazon", 100], ["u1", "Netflix", 15], ["u3", "Amazon", 10]], threshold = 40
Output: "Amazon"

Run this challenge interactively in Python or JavaScript when the app loads.