⌘K
Flycodx

JEE Rank Aggregation Logic

JEE Rank Aggregation Logic

HardArrays100% accepted

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

scores=[[95,98,92],[0,90,85],[88,92,91],[75,80,85]]

Output

2
solution.py
Loading editor...
Test 1
Test 2
Test 3

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
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3