/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static int hour2minutes
(String fullhour
) {
String[] parts
= fullhour.
split(":");
int hour
= Integer.
parseInt(parts
[0]); int min
= Integer.
parseInt(parts
[1]);
return (hour* 60) + min; //Pega o total
}
{
System.
out.
println(hour2minutes
("12:39")); System.
out.
println(hour2minutes
("16:20")); System.
out.
println(hour2minutes
("23:59")); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCiAgICBwdWJsaWMgc3RhdGljIGludCBob3VyMm1pbnV0ZXMoU3RyaW5nIGZ1bGxob3VyKQogICAgewogICAgCVN0cmluZ1tdIHBhcnRzID0gZnVsbGhvdXIuc3BsaXQoIjoiKTsKICAgIAogICAgICAgIGludCBob3VyID0gSW50ZWdlci5wYXJzZUludChwYXJ0c1swXSk7CiAgICAgICAgaW50IG1pbiA9IEludGVnZXIucGFyc2VJbnQocGFydHNbMV0pOwogICAgCiAgICAgICAgcmV0dXJuIChob3VyKiA2MCkgKyBtaW47IC8vUGVnYSBvIHRvdGFsCiAgICB9CgoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU3lzdGVtLm91dC5wcmludGxuKGhvdXIybWludXRlcygiMTI6MzkiKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKGhvdXIybWludXRlcygiMTY6MjAiKSk7CgkJU3lzdGVtLm91dC5wcmludGxuKGhvdXIybWludXRlcygiMjM6NTkiKSk7Cgl9Cn0=