Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're gonna bring numpy into it you may as well use np.diff():

    def maxWidthOfVerticalArea(self, points: List[List[int]]) -> int:
        return np.diff(sorted(x for x, _ in points)).max()


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: