Leetcode 856 Python Count Method In Js