WBI2AI7VAEDJQROSI34TXIL7EA35SXPHH75RPZJXRUE567VV4XXAC
WJKIYSJTMACY2EAATHTTRMT5WKV7HUKBA4KHVGK3VO35EA3QYENAC
hour int min int
hour int
min int
func New(hour, minute int) Clock { // handle hour turns because of mins if minute >= 0 { hour += minute / 60 } else { hour += (minute+1)/60 - 1
func New(hour, minute int) Clock {
// handle hour turns because of mins
if minute >= 0 {
hour += minute / 60
} else {
hour += (minute+1)/60 - 1
func New(hour, min int) Clock { min = min + hour*60 min %= 24 * 60 if min < 0 { min += 24 * 60
func New(hour, min int) Clock {
min = min + hour*60
min %= 24 * 60
if min < 0 {
min += 24 * 60
// first normalize, then make it positive minute = minute % 60 if minute < 0 { minute += 60 } hour %= 24 if hour < 0 { hour += 24 } return Clock{hour: hour, min: minute}
// first normalize, then make it positive
minute = minute % 60
if minute < 0 {
minute += 60
}
hour %= 24
if hour < 0 {
hour += 24
return Clock{hour: hour, min: minute}
return Clock{min: min}
h := strconv.Itoa(c.hour) if c.hour < 10 {
h := strconv.Itoa(c.hour)
if c.hour < 10 {
hour := c.min / 60 h := strconv.Itoa(hour) if hour < 10 {
hour := c.min / 60
h := strconv.Itoa(hour)
if hour < 10 {
c.min = c.min % 60
return New(c.hour, c.min+minutes)
return New(0, c.min+minutes)
return New(c.hour, c.min-minutes)
return New(0, c.min-minutes)