##### Welcome to Subscribe On Youtube

# 3288. Length of the Longest Increasing Path

## Description

You are given a 2D array of integers `coordinates`

of length `n`

and an integer `k`

, where `0 <= k < n`

.

`coordinates[i] = [x`

indicates the point _{i}, y_{i}]`(x`

in a 2D plane._{i}, y_{i})

An **increasing path** of length `m`

is defined as a list of points `(x`

, _{1}, y_{1})`(x`

, _{2}, y_{2})`(x`

, ..., _{3}, y_{3})`(x`

such that:_{m}, y_{m})

`x`

and_{i}< x_{i + 1}`y`

for all_{i}< y_{i + 1}`i`

where`1 <= i < m`

.`(x`

is in the given coordinates for all_{i}, y_{i})`i`

where`1 <= i <= m`

.

Return the **maximum** length of an **increasing path** that contains `coordinates[k]`

.

**Example 1:**

**Input:** coordinates = [[3,1],[2,2],[4,1],[0,0],[5,3]], k = 1

**Output:** 3

**Explanation:**

`(0, 0)`

, `(2, 2)`

, `(5, 3)`

is the longest increasing path that contains `(2, 2)`

.

**Example 2:**

**Input:** coordinates = [[2,1],[7,0],[5,6]], k = 2

**Output:** 2

**Explanation:**

`(2, 1)`

, `(5, 6)`

is the longest increasing path that contains `(5, 6)`

.

**Constraints:**

`1 <= n == coordinates.length <= 10`

^{5}`coordinates[i].length == 2`

`0 <= coordinates[i][0], coordinates[i][1] <= 10`

^{9}- All elements in
`coordinates`

are**distinct**. `0 <= k <= n - 1`