7 kyu

Radio DJ helper function

Description:

The Problem

James is a DJ at a local radio station. As it's getting to the top of the hour, he needs to find a song to play that will be short enough to fit in before the news block. He's got a database of songs that he'd like you to help him filter in order to do that.

What To Do

Create longestPossible(longest_possible in python and ruby) helper function that takes 1 integer argument which is a maximum length of a song in seconds.

songs is an array of objects which are formatted as follows:

{artist: 'Artist', title: 'Title String', playback: '04:30'}
{'artist': 'Artist', 'title': 'Title String', 'playback': '04:30'}
{artist: 'Artist', title: 'Title String', playback: '04:30'}

You can expect playback value to be formatted exactly like above.

Output should be a title of the longest song from the database that matches the criteria of not being longer than specified time. If there's no songs matching criteria in the database, return false.

Sorting
Filtering
Algorithms

Stats:

CreatedOct 12, 2015
PublishedOct 12, 2015
Warriors Trained1737
Total Skips90
Total Code Submissions5694
Total Times Completed855
JavaScript Completions375
Python Completions436
Ruby Completions81
Total Stars29
% of votes with a positive feedback rating89% of 183
Total "Very Satisfied" Votes151
Total "Somewhat Satisfied" Votes24
Total "Not Satisfied" Votes8
Ad
Contributors
  • patrickwalkowicz Avatar
  • joh_pot Avatar
  • CrazyMerlyn Avatar
  • hilary Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad