how are u sure that the AND arrays generated are decreasing in nature?
@skskksksSkskksks7 ай бұрын
nvm i understood; bits might or might not get unset as more numbers are iterated so it's decreasing
@codingmohan7 ай бұрын
Yeah I realised that I forgot to explain that part. Glad that you asked. The AND of 2 numbers is always smaller than (or equal to) both the individual numbers. Why? - If a bit is set in any one of the number, the bit can be set in AND if and only if both the numbers have that particular but set. I.e. if a bit is set in AND, it means it is set in both numbers and if it is unset in AND, it means that numbers might have it set or unset. Hence AND is always smaller than both the numbers. Further, if you keep ANDing more numbers, the value can only decrease because once a bit is unset in AND, you can't set it back with any number. Hope it clarifies. Feel free to ask any follow up questions.
@Truysジャ7 ай бұрын
@@codingmohan if that is the case in 17:44 in the upper bound function. Don't you think the condition l = m+1 and r = m, should be vice versa.
@Cools747 ай бұрын
15:10 There is slight mistake in pseudo code If(and[ start.... m]
@codingmohan7 ай бұрын
Nice catch.
@AnandKumar-kz3ls7 ай бұрын
was able to solve all 4 question by my own thanks mohan please don't stop making videos
@yatri63297 ай бұрын
Bhagwan h Bhai tum 700+ Q kar liya Leetcode p but Aaj Tak kbhi 2 se jyda Q nhi kar paya contest m
@MrSaint-ch6xn6 ай бұрын
@@yatri6329 ha bhai mene bhi abhi 500 + kiye hai but 3rd pe hi hug deta hu
@yatri63296 ай бұрын
@@MrSaint-ch6xn dimag tej nhi h mera nothing else
@Cools747 ай бұрын
Thank you man for various approaches 🤗
@souravshaw89047 ай бұрын
Awesome explanation❤
@MrSaint-ch6xn6 ай бұрын
The question is now changed from AND to OR
@ravenarc36527 ай бұрын
Review vutrubac's solution for once. Good video btw, really helpful 🙏🏻
@L_Yassine7 ай бұрын
thanks sir
@gui-codes7 ай бұрын
it's too complex man.
@codingmohan7 ай бұрын
Which of the 2 solutions you found difficult? And if you can help understand which part is exactly not clear, maybe I could help.
@rohitsinha35197 ай бұрын
@codingmohan He is probably talking about 2nd approach. At the end you said there are problems where find logN values are better than building array, can you comment out such questions example?
@darshanrajpattanaik21547 ай бұрын
@@rohitsinha3519 He's wrong there, building the array is optimal approach
@iWontFakeIt7 ай бұрын
contest me ye solve hogya aj! aj alag hi confidence level h! ye and function monotonic wala approach bhaiya aap ne pehle ek video me bhi sikhaya tha isliye dimag me chamak gya :) 🫡
@iWontFakeIt7 ай бұрын
your approach 2 is amazing; learnt something new again