There seems to be a testcase missing that fails when a solution tries to eagerly forget about seldom entries. In the following test case, 0 is the most frequent entry ...
This solution isn’t expected to pass because it runs in O(n²) time, and the constraints state that both the needle and haystack can be up to 10⁴ characters long—implying up to 10⁸ operations in the ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results