The Wayback Machine - https://web.archive.org/web/20211129064840/https://leetcode.com/discuss/53206/a-solution-using-a-group-by-and-another-one-using-a-self-join