• + 0 comments

    Good problem. The editorial is not worth unlocking though: it just links to a cryptic paper which can only be implemented in C++. The proposed algorithm is too slow for other languages. There are faster algorithms, but the editorial does not mention them.