Rating System In Leetcode Python