public class Solution {
public boolean canConstruct(String ransomNote, String magazine) {
if (ransomNote == null || magazine == null) {
return false;
}
int[] index = new int[26];
for (int i = 0; i < magazine.length(); i++) {
index[magazine.charAt(i) - 'a']++;
}
for (int j = 0; j < ransomNote.length(); j++) {
if (--index[ransomNote.charAt(j) - 'a'] < 0) {
return false;
}
}
return true;
}
}
在网上看到了这个答案,请问第九行也就是 index[magazine.charAt(i) - 'a']++;用C语言该如何实现呢?