/add-minutes

Ruby implementation of a simple add-minutes problem without using Date or Time class.

Primary LanguageRuby

add-minutes

Ruby implementation of a simple add-minutes problem without using Date or Time class.

Programming challenge:

Without using any built in date or time functions, write a program that accepts two mandatory arguments. The first argument is a string of the format “[H]H:MM {AM|PM}” and the second argument is an integer. Assume the integer is the number of minutes to add to the string. The return value or output of the program should be a string of the same format as the first argument. For example AddMinutes(”9:13 AM”, 10) would return “9:23 AM”.