Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 359 Bytes

1332. 删除回文子序列.md

File metadata and controls

17 lines (12 loc) · 359 Bytes
  • 脑筋急转弯
function removePalindromeSub(s: string): number {

    for (let left = 0, right = s.length - 1; left < right; ++left, --right) {
        if (s[left] !== s[right]) {
            return 2;
        }
    }

    return 1;
};