Snowflake Interview Question

One easy ad-hook. Trie. Binary search on a 2d prefix sum