Leetcode in Java && Oracle
422 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2022-05-24_13-59-41.png
25.6 KB
#N2278. Percentage of Letter in String
problem link
#solution
class Solution {
public int percentageLetter(String s, char letter) {
int count=0;
for(char ch: s.toCharArray())
if(ch==letter) count++;
return count*100/s.length();
}
}