7 kyu

Traffic Count During Peak Hours

697 of 744BrianC

Description:

You work for a company that analyzes traffic count at a particular intersection during the peak hours of 4:00 PM to 8:00 PM. Each day, you are given a list that contains the number of vehicles that pass through the intersection every 10 minutes from 4:00 to 8:00 PM.

You are expected to return a list of tuples that each contain the hour and the maximum amount of traffic for each hour.

For example:

a1 = [23,24,34,45,43,23,57,34,65,12,19,45, 54,65,54,43,89,48,42,55,22,69,23,93]

traffic_count(a1) ==> [('4:00pm', 45), ('5:00pm', 65), ('6:00pm', 89), ('7:00pm', 93)]

All values in the given list are integers.

Fundamentals
Lists

More By Author:

Check out these other kata created by BrianC

Stats:

CreatedJan 5, 2017
PublishedJan 5, 2017
Warriors Trained1204
Total Skips23
Total Code Submissions1732
Total Times Completed744
Python Completions697
Ruby Completions64
Total Stars20
% of votes with a positive feedback rating92% of 192
Total "Very Satisfied" Votes164
Total "Somewhat Satisfied" Votes26
Total "Not Satisfied" Votes2
Total Rank Assessments22
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • BrianC Avatar
  • SagePtr Avatar
  • anter69 Avatar
  • smile67 Avatar
  • hobovsky Avatar
Ad