DrawCode Practice Problem

Top N per Category (Window)

Given product sales `(category, product, revenue)`, use a window function to find the top 3 products by revenue within each category.

Examples

Input

sales rows across categories

Output

top 3 products per category

Constraints


Interactive Visualizer Workspace

Explore step-by-step interactive animations, memory state tracking, and live multi-language execution in DrawCode.

Launch Interactive Visualizer