Count Primes Leetcode Solution In Python