6 kyu

Simple time difference

588 of 1,513KenKamau

Description:

In this Kata, you will be given a series of times at which an alarm sounds. Your task will be to determine the maximum time interval between alarms. Each alarm starts ringing at the beginning of the corresponding minute and rings for exactly one minute. The times in the array are not in chronological order. Ignore duplicate times, if any.

For example:
solve(["14:51"]) = "23:59". If the alarm sounds now, it will not sound for another 23 hours and 59 minutes.
solve(["23:00","04:22","18:05","06:24"]) == "11:40". The max interval that the alarm will not sound is 11 hours and 40 minutes.

In the second example, the alarm sounds 4 times in a day.

More examples in test cases. Good luck!

Algorithms
Date Time
Strings

Stats:

CreatedAug 17, 2018
PublishedAug 17, 2018
Warriors Trained5311
Total Skips136
Total Code Submissions11049
Total Times Completed1513
JavaScript Completions472
Ruby Completions62
Python Completions588
C Completions44
C++ Completions117
Java Completions119
C# Completions115
Rust Completions44
Total Stars175
% of votes with a positive feedback rating90% of 333
Total "Very Satisfied" Votes282
Total "Somewhat Satisfied" Votes38
Total "Not Satisfied" Votes13
Total Rank Assessments7
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • KenKamau Avatar
  • siebenschlaefer Avatar
  • imjasonmiller Avatar
  • Blind4Basics Avatar
  • barakplasma Avatar
  • clcraig Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • __eloise__ Avatar
  • saudiGuy Avatar
Ad