<p>Given a <strong>0-indexed</strong> integer array <code>nums</code>, return <code>true</code> <em>if it can be made <strong>strictly increasing</strong> after removing <strong>exactly one</strong> element, or </em><code>false</code><em> otherwise. If the array is already strictly increasing, return </em><code>true</code>.</p>

<p>The array <code>nums</code> is <strong>strictly increasing</strong> if <code>nums[i - 1] &lt; nums[i]</code> for each index <code>(1 &lt;= i &lt; nums.length).</code></p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> nums = [1,2,<u>10</u>,5,7]
<strong>Output:</strong> true
<strong>Explanation:</strong> By removing 10 at index 2 from nums, it becomes [1,2,5,7].
[1,2,5,7] is strictly increasing, so return true.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> nums = [2,3,1,2]
<strong>Output:</strong> false
<strong>Explanation:</strong>
[3,1,2] is the result of removing the element at index 0.
[2,1,2] is the result of removing the element at index 1.
[2,3,2] is the result of removing the element at index 2.
[2,3,1] is the result of removing the element at index 3.
No resulting array is strictly increasing, so return false.</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> nums = [1,1,1]
<strong>Output:</strong> false
<strong>Explanation:</strong> The result of removing any element is [1,1].
[1,1] is not strictly increasing, so return false.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>2 &lt;= nums.length &lt;= 1000</code></li>
	<li><code>1 &lt;= nums[i] &lt;= 1000</code></li>
</ul>

class Solution:
    def canBeIncreasing(self, nums: List[int]) -> bool:
        for index, element in enumerate(nums):
            print("check",index,element)
            if index == 0:
                if all(nums[i]<nums[i+1] for i in range(1,len(nums)-1)):
                    return True
            elif index == len(nums)-1:
                if all(nums[i]<nums[i+1] for i in range(len(nums)-2)):
                    return True
            elif all(nums[i]<nums[i+1] for i in range(index-1)) and all(nums[i]<nums[i+1] for i in range(index+1,len(nums)-1)) and nums[index-1] < nums[index+1]:
                return True
                    
        return False

    def canBeIncreasing_self(self, nums: List[int]) -> bool:
        count = 0
        index = -1
        for i in range(len(nums)-1):
            prev, curr = nums[i], nums[i+1]
            if prev >= curr:
                count += 1
                index = i
            if count > 1:
                return False
        print("count",count,"index",index)
        if count == 0:
            return True
        elif count == 1:
            if len(nums) == 2:
                return True
            if nums[index-1] < nums[index+1]:
                return True
            if index == 0:
                return True
            if index == len(nums)-2:
                return True
        return False
276