class Solution {
public int rearrangeCharacters(String s, String target) {
int[] cnt = new int[30];
for (char c : s.toCharArray()) {
cnt[c-'a'] ++;
}
int res = 0;
while(true) {
for (char c : target.toCharArray()) {
cnt[c-'a']--;
if (cnt[c-'a'] <0) {
return res;
}
}
res++;
}
}
}
标签:字符,cnt,int,2287,重排,字符串
From: https://www.cnblogs.com/eiffelzero/p/17051007.html