2278. Percentage of Letter in String
Easy
Given a string s
and a character letter
, return the percentage of characters in s
that equal letter
rounded down to the nearest whole percent.
Example 1:
Example 2:
Constraints:
1 <= s.length <= 100
s
consists of lowercase English letters.letter
is a lowercase English letter.
解題
這題如果用 float32
, 會在一題測資出錯。
Runtime: 0 ms, faster than 100.00%
Memory Usage: 2 MB, less than 61.82%
Previous2273. Find Resultant Array After Removing AnagramsNext2279. Maximum Bags With Full Capacity of Rocks
Last updated