JEE Rank Aggregation Logic
JEE Rank Aggregation Logic
The JEE counseling office in Delhi receives scores from N students across Physics, Chemistry, and Math. Ranks must be assigned by finding the longest subarray of consecutive valid scores (where no score is 0 or exceeds 300) and applying bonus adjustments. Rule: a student row is valid when all 3 scores are >0 and <=300. Return the length of the longest run of consecutive valid students. Your solve(...) function receives the inputs as ready-made arguments — no input reading or parsing needed; just return the answer.
Approach
Given a 2D array of N students with 3 scores each, find the longest sequence where all students have valid scores (1-300 each), then multiply those student's final scores by sequence length.
Input
Output
More Arrays problems
Browse all coding problems →Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards