Description: Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if there exists i, j, k such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k ≤ n-…
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if there exists i, j, k such that arr[i] < arr[j] < arr[k] given 0 ≤ i < j < k ≤ n-1 else return…
public class Solution { public bool IncreasingTriplet(int[] nums) { var len = nums.Length; ) { return false; } ; i <= len - ; i++) { ; j <= len - ; j++) { if (nums[i] < nums[j]) { ; k <= len - ; k++) { if (nums[j] < nums[k]) { return true;…