New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
JobRadar
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Snowflake
Coding Question
AI Insights
Quick Summary
Iterate through all query types to calculate how many times each fits within the time limit k.
Compute the total profit for each type by multiplying the execution count by the profit per execution.
Identify the query yielding the maximum total profit, prioritizing the smallest index in case of ties.
What This Tests
Single-pass array iteration and state tracking
Integer division and arithmetic logic
Implementing comparison logic with tie-breaking rules
Handling edge cases where no solution is feasible
Common Patterns
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected