Find the Needle in the Haystack (Robbers) This is part of a cops-and-robbers challenge. Go here for the cops' part.

The Robbers' Challenge

A cop's answer can be cracked by removing any subset of characters from the Haystack program, so that it outputs Needle instead of Haystack (while still being a valid submission in the same language). You don't have to find the exact same solution as the cop intended, as long as yours is valid by the above constraints.

If you manage this, post an answer with the solution, linking to the cop's answer, and leave a comment on the cop's answer linking back to yours.

The robber who cracks the most cop answers wins. Ties are broken by the sum of sizes of the cracked cop answers (in favour of the robber who cracks longer submissions).

Each cop answer can only be cracked once, and of course, you're not allowed to crack your own answer. If the cop's answer turns out to be invalid before or after being cracked, it is not counted towards the robber's score.

Examples

Here are a couple of simple examples in different languages:

Ruby

Haystack: puts 1&gt;0?"Haystack":"Needle"
Delete:        XXXXXXXXXXXXXXX
Needle:   puts "Needle"

Python 2

Haystack: print "kcatsyaHeldeeN"[-7::-1]
Delete:          XXXXXXXX        XX
Needle:   print "eldeeN"[::-1]


Note that the subset of removed characters doesn't have to be contiguous.
JavaScript, 85 bytes (ES6)

Cracks Arnauld's answer

f=(k=b=x=35)=&gt;x--?f(k*4853461&amp;268435455):k&amp;2?'N'+(k^12408877).toString(b):'Haystack'


"Needle" demo



f=(k=b=x=35)=&gt;x--?f(k*4853461&amp;268435455):k&amp;2?'N'+(k^12408877).toString(b):'Haystack'

console.log(f())




Explanation

The original function was:

f=(k=b=x=35)=&gt;x--?f(k*74837258394056219&amp;268435455):k&amp;2?'N'+(k^124038877).toString(b):'Haystack'


which is more readable as:

f = (k=b=x=35) =&gt; {
    if (x--) {
        return f(k*74837258394056219&amp;268435455);
    } else {
        if (k&amp;2) {
            return 'N'+(k^124038877).toString(b);
        } else {
            return 'Haystack';
        }
    }
}


Note that when n=21625674, then n.toString(35) is 'eedle'.

The 35 in the input probably cannot be changed to a subset (because we want a base large enough to contain all the letters 'del', so we need a base that's at least 22). So the numbers to change are 74837258394056219, 268435455, and 124038877. We want to replace them with numbers a, b, c, each formed with a subset of the digits of the original numbers, such that the function g(k) = (k * a &amp; b), starting with k=35 and iterated 35 times, and then XORed with c, gives 21625674.

For this one, after thinking a bit, as the lengths are small (the maximal a has length 17, b and c have length 9), I just used brute-force :-) Wrote a C++ program to generate all possible numbers a, b, c formed as subsets of the original numbers, iterate through all a and b, and check whether the required c was in the set. Runs in about 15 seconds, and the only output is a=4853461, b=268435455, c=12408877 (turns out the number b doesn't need to be changed). I'm not sure whether there's a more clever way of inverting this function.