• + 1 comment

    i believe i first learned this approach here (lost hackerrank account, sigh..) and used it to solve other problems from other contests (so thanks!) but i also want to note that this does not work well against more frequent queries of max values, or any value.