Return whether a string is a palindrome if you can delete at most k elements
You have a question embedded in the code:


void(set.delete(char) || set.add(char)); // &lt;--is this good code?



The void operator "evaluates the given expression and then returns undefined"1. It doesn't appear that there is a need to have undefined be the final value of that expression because that expression doesn't get assigned or returned. The void() can be removed without changing the functionality of the code. I wouldn't say it is bad code, but unnecessary. 



That for loop could be simplified:


for (let i = 0, len = str.length; i &lt; len; i++) {
  const char = str[i];
  void(set.delete(char) || set.add(char)); // &lt;--is this good code?
}



using a for...of loop:

for (const char of str) {
  set.delete(char) || set.add(char);
}


1https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void