• + 0 comments

    It is worth noting that you can also solve this with convolutions, which could be helpful on huge arrays, since they can be solved with an fft in nlogn time.