hard

[Leetcode 329] Longest Increasing Path in a Matrix

Question Leetcode 329: Longest Increasing Path in a Matrix Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outside of the boundary (i.e. wrap-around is not allowed). Examples: Example 1: Input: nums = [ [9,9,4], [6,6,8], [2,1,1] ] Output: 4 Explanation: The longest increasing path is [1, 2, 6, 9].

[Leetcode 768/769] Max Chunks To Make Sorted

Question 1 Leetcode 769: Max Chunks To Make Sorted II Given an array arr of integers (not necessarily distinct), we split the array into some number of “chunks” (partitions), and individually sort each chunk. After concatenating them, the result equals the sorted array. What is the most number of chunks we could have made? Note: arr will have length in range [1, 2000]. arr[i] will be an integer in range [0, 10**8].