Made the algorithm in (a). Forgot to exclude the diagonal when finding max value.