Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use monotonic stack.
Store for each element <code>grid[i][j]</code>, the longest increasing subarray of <code>grid[i]</code> ending at index <code>j</code>.
Solve with full IDE support and test cases