3288. Length of the Longest Increasing Path
You are given a 2D array of integers
coordinates
of lengthn
and an integerk
, where0 <= k < n
.
coordinates[i] = [xi, yi]
indicates the point(xi, yi)
in a 2D plane.An increasing path of length
m
is defined as a list of points(x1, y1)
,(x2, y2)
,(x3, y3)
, …,(xm, ym)
such that:
xi < xi + 1
andyi < yi + 1
for alli
where1 <= i < m
.(xi, yi)
is in the given coordinates for alli
where1 <= i <= m
.Return the maximum length of an increasing path that contains
coordinates[k]
.
c++
1 | struct Seg { |