## Remove One Element to Make the Array Strictly Increasing

Remove One Element to Make the Array Strictly Increasing Solution Given a 0-indexed integer array nums, return true if it can be made strictly increasing after removing exactly one element, or false otherwise. If the array is already strictly increasing, return true. The array nums is strictly increasing if nums[i – 1] < nums[i] for each index (1 <= i < nums.length). Example 1: Input: nums = [1,2,10,5,7]Output: trueExplanation: By removing 10 at index … Read more

## Tree Diameter SOLUTION Leetcode

Tree Diameter SOLUTION Leetcode Given an undirected tree, return its diameter: the number of edges in a longest path in that tree.The tree is given as an array of edges where edges[i] = [u, v] is a bidirectional edge between nodes u and v.  Each node has labels in the set {0, 1, …, edges.length}. … Read more

## Palindrome Removal SOLUTION Leetcode

Palindrome Removal SOLUTION Given an integer array arr, in one move you can select a palindromic subarray arr[i], arr[i+1], …, arr[j] where i <= j, and remove that subarray from the given array. Note that after removing a subarray, the elements on the left and on the right of that subarray move to fill the … Read more

## Count Good Nodes in Binary Tree SOLUTION

Count Good Nodes in Binary Tree SOLUTION This question is quick straightforward: top-down recursion. And we need to pass down the maximum value so far during recursion. SOLUTION Please see the code below: