https://profilbaru.com/en/Diagonal_method