Whole hours between two date-time pairs

Report a typo

The problem statement
Write a program that calculates how many whole hours are between the two date-time pairs of the same year.

Input data format
Two lines containing a date-time in a year-month-dayThour:minute format (without seconds and nanoseconds).

Output data format
The line containing an integer non-negative number.

Sample Input 1:

2017-06-15T01:50
2017-06-16T01:10

Sample Output 1:

23

Sample Input 2:

2017-06-15T01:50
2017-06-15T02:50

Sample Output 2:

1
Write a program in Java 17
class Main {
public static void main(String[] args) {
// put your code here
}
}
___

Create a free account to access the full topic