JS-Easy to understand for beginners as well(2 solutions)
\nvar findLengthOfLCIS = function (nums) {\n  let count = 1,\n    max = 0;\n  for (let i = 1; i < nums.length; i++) {\n    if (nums[i] > nums[i - 1]) {\n      c
```\nvar findLengthOfLCIS = function (nums) {\n  let count = 1,\n    max = 0;\n  for (let i = 1; i < nums.length; i++) {\n    if (nums[i] > nums[i - 1]) {\n      count++;\n      max = Math.max(max, count);\n    } else {\n      count = 1;\n    }\n  }\n  return nums.length >= 1 ? (max > 0 ? max : count) : 0;\n};\n\n```\n\nSecond solution:\n```\nvar findLengthOfLCIS = function(nums) {\n    if(nums.length==0) return 0\n    let count=1,max=1;\n    for(let i=0;i<nums.length-1;i++){\n        if(nums[i]<nums[i+1]){\n            count++;\n            max=Math.max(count,max);\n        }else{\n            count=1;\n        }\n    }\n    return max;\n};\n```\n\nIgnore the below solution(this is for the guy who asked another ques in the comment)\n```\nconst longestIncreaseWithInBoundary = (arr, indices) => {\n  // converting 2D array to 1D\n  // [[0, 5],[1, 5],[2, 5],[2, 2]] will be [0, 5, 1, 5, 2, 5, 2, 2]\n  const flatIndices = indices.flat();\n\n  const findLongest = (sliced) => {\n    // this is the old method which is used in this question\n    let count = 1,\n      max = 0;\n    for (let i = 1; i < sliced.length; i++) {\n      if (sliced[i] > sliced[i - 1]) {\n        count++;\n        max = Math.max(count, max);\n      } else {\n        count = 1;\n      }\n    }\n    return max > 0 ? max : count;\n  };\n\n let res = [],\n    map = new Map();\n  // iterating the 1D(which we converted...we converted because we can avoid inner for loop)\n  for (let i = 0; i < flatIndices.length; i += 2) {\n    // this takes a part of given nums\n    // for example, part of [2,1,3,5,4,7] with  boundary [2,5] is [3,5,4,7]\n    const slicedArr = arr.slice(flatIndices[i], flatIndices[i + 1] + 1);\n    // if that value is already stored we can take from that map(no need to pass to the helper func)\n    if (map.has(flatIndices[i] + "" + flatIndices[i + 1])) {\n      res.push(map.get(flatIndices[i] + "" + flatIndices[i + 1]));\n    } else {\n      // passing that sliceArr into the helper function(name whatever u want)\n      const length = findLongest(slicedArr);\n      // storing that returned value in the map\n      map.set(flatIndices[i] + "" + flatIndices[i + 1], length);\n      // pushing the returned max subarray value\n      res.push(length);\n    }\n  }\n  // returning the array which holds the max subarray correspondingly.\n  // [3,3,2,1]\n  return res;\n};\nconsole.log(\n  longestIncreaseWithInBoundary(\n    [2, 1, 3, 5, 4, 7],\n    [\n      [0, 5],\n      [1, 5],\n      [2, 5],\n      [2, 2],\n    ]\n  )\n);\n```\nBut still Im not giving you assurance that this will work if large number of data is passed.Try it and let me know.
['JavaScript']