Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 15 Sep 2017 My Price 10.00

number of moments

Given two times when seen on a digital clock, count the number of moments between these two times (both start and end time included) when the time was a palindrome.

A digital clock shows time in the format HH:MM:SS (hours:minutes:seconds).

For example, 2:40:38 pm is represented as 14:40:38.

Input

The first line contains q queries.
This is followed by q lines each containing two time strings, t1 and t2, which are 6 digit integers that represent times shown by a digital clock. It is ensured that t1 and t2 are valid times.

Output

  • Each output on a new line.

 

Constraints

  • 1 = q = 105
  • t1 and t2 are of the form HH:MM:SS
  • t1 occurs on or before t2

 

Example

Input: 4 00:00:01 00:00:01 09:09:09 13:34:57 11:11:11 11:11:11 02:38:15 03:01:16 Output: 0 22 1 3

 

Explanation

Case 1: Only 1 moment is considered in this case, i.e., 00:00:01. We can clearly see that 00:00:01 is not a palindromic string.
Case 4: Between 02:38:15 and 03:01:16, there are 3 moments that are palindromic strings. They are 02:44:20, 02:55:20 and 03:00:30.


Note that the time as seen on a digital clock should appear as a palindrome. 1 is a palindrome, but 00:00:01 on a digital clock is not.

Answers

(5)
Status NEW Posted 15 Sep 2017 11:09 PM My Price 10.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)