(s)
| 3 | * @return {boolean} |
| 4 | */ |
| 5 | var validPalindrome = function (s) { |
| 6 | let l = 0; |
| 7 | let r = s.length - 1; |
| 8 | |
| 9 | while (l < r) { |
| 10 | console.log(l, r); |
| 11 | if (s[l] !== s[r]) { |
| 12 | const skipL = s.slice(l + 1, r + 1); |
| 13 | const skipR = s.slice(l, r); |
| 14 | return isPalindrome(skipL) || isPalindrome(skipR); |
| 15 | } |
| 16 | l++; |
| 17 | r--; |
| 18 | } |
| 19 | return true; |
| 20 | }; |
| 21 | |
| 22 | const isPalindrome = (s) => { |
| 23 | let l = 0; |
nothing calls this directly
no test coverage detected