Question:1549D - У чисел есть друзья My Solution:124753951
My implementation: get the absolute values of differences between two neighbouring cells and then implement the sparse table to get the queries faster. Now using sliding window technique find the max length of window.
Context: I have pretty much tried to implement the solution given in the editorial. Any insight is highly helpful. Thanks.
$$$j+2^{i-1}$$$ $$$(dp[i-1][j+(1$$$<<$$$(i-1))])$$$ can be greater than $$$n$$$.