A problem of leetcode
related codes
/ / Please paste the code text below (do not replace the code with pictures)
/**
* @param {string} s
* @return {number}
*/
var longestPalindromeSubseq = function(s) {
let arrNum = s.split("");
let arrMap = new Map();
let maxNum = 1;
for(let i = 0;i<arrNum.length;iPP){
if(arrMap.has(arrNum[i])){
arrMap.set(arrNum[i],arrMap.get(arrNum[i])+1);
if(maxNum<=(arrMap.get(arrNum[i]))){
maxNum = arrMap.get(arrNum[i]);
}
}else {
arrMap.set(arrNum[i],1);
}
}
return maxNum;
};
what result do you expect? What is the error message actually seen?