⌘K
Flycodx

JioSaavn Download Storage Optimizer

JioSaavn Download Storage Optimizer

EasyArrays100% accepted

Ravi has 500MB free storage and wants to maximize JioSaavn songs for offline listening. Given song file sizes, find how many consecutive songs from start fit in storage limit.

Approach

Given array of song sizes in MB and storage limit, count max consecutive songs from start.

Input

5 100 150 180 200] 500

Output

3
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