One of the questions of leetcode, there is nothing wrong with the answer, how can I fail to test it?

A problem of leetcode

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?

clipboard.png

May.22,2021

it turns out that I don't even understand the meaning of the question, and I don't even know what the longest palindromes are

.
Menu