```python
def check_gap(from_hour: int, from_minute: int, to_hour: int, to_minute: int) -> int:
    if from_hour > 23 or from_hour > 23:
        raise ValueError("Hours must be between 0 23")

    if from_minute > 59 or to_minute > 59:
        raise ValueError("Minutes must are between 0 59")

    if from_hour == to_hour and from_minute == to_minute:
        return 0

    if from_hour < to_hour:
        return to_minute - from_minute

    if from_hour > to_hour:
        return (24 - from_minute) + to_minute
```