2278. Percentage of Letter in String

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2278

class Solution:
    def percentageLetter(self, s: str, letter: str) -> int:
        return s.count(letter) * 100 // len(s)