We take it because we cannot take -1, as we're using the min function. Taking n+1 ensures that it is an impossible case, as Subarray length cannot be more than the length of the array. So when we return ans, we ensure that ans is not n+1, otherwise we return -1.
Radhe Radhe. thanx you for the solution. really very helpful.
Glad it was helpful!
Thankyou so much maam ,
Radhe radhe !
Glad it was helpful!
Thank you di. solved today's problem of the day 😃
Glad to hear it!
❤❤
good explain mam....sath me thod concept bhi explain kr diya karo
Will improve, Thanks!
how you developed your logic skill.. i am trying hard but still lacking can you help me please
Keep practicing and you will develop your logic skills over time!
aur voice bhi thoda tej kar dijiye mam
at 9:20 why r u taking the ans =n+1 or 4 ?
We take it because we cannot take -1, as we're using the min function. Taking n+1 ensures that it is an impossible case, as Subarray length cannot be more than the length of the array.
So when we return ans, we ensure that ans is not n+1, otherwise we return -1.
12 Nov ka POTD ??
Hii