Thank you. Can you make a list of mediums you had please? Also do you have a list of mid-hard questions you would recommend preparing for interview please?
I will add it to my to-do list to make these playlists. In a meantime, definitely check out: 1) 322. Coin Change 2) 518. Coin Change 2 3) 647. Palindromic Substrings 4) 475. Heaters 5) 542. 01 Matrix 6) 46. Permutations
@@ifelsestatement7803 Hey, I am still not sure abt time complexity. The binary search actually depend on the value of the smallest and largest element of the matrix so time complexity will actually depend on the values?
The middle is calculated in this way so as to avoid Integer Overflow. Adding 2 integers may produce a value which exceeds the acceptable integer limits. Hence we calculate the mid in this manner.
conceptually it is true. But when implemented as (min+max)/2, the result may overflow as we have a permissible range for any datatype. For example, (2147483600+2147483647)/2 would overflow, while 2147483600+(2147483647-2147483600)/2 won't. Mathematically, both are equivalent.
great!!! what's the TC of the last approach?
watched a lot of videos on repeat but your video made it crystal clear in one go... THANK YOU keep it up loved it
Thank you so much for your comment! I am very glad it helped you!
Thank you. Can you make a list of mediums you had please? Also do you have a list of mid-hard questions you would recommend preparing for interview please?
I will add it to my to-do list to make these playlists. In a meantime, definitely check out:
1) 322. Coin Change
2) 518. Coin Change 2
3) 647. Palindromic Substrings
4) 475. Heaters
5) 542. 01 Matrix
6) 46. Permutations
Great explanation, thank you so much.
I am glad it helped you! Thak you for your comment!
in the countLessOrEqual function, why is the starting point in the right most column?
Thank you for this video by the way, greatly appreciated!
Thank you so much. This video was really helpful to understand how the binary search solution worked.
I am very happy that I was able to help you! Thanks for watching!
@@ifelsestatement7803 Hey, I am still not sure abt time complexity. The binary search actually depend on the value of the smallest and largest element of the matrix so time complexity will actually depend on the values?
Appreciate your explanation, very clear.
Glad it was helpful to you! Thanks!
isn't the middle element (min + max)/2?
The middle is calculated in this way so as to avoid Integer Overflow. Adding 2 integers may produce a value which exceeds the acceptable integer limits. Hence we calculate the mid in this manner.
Nice solution!
Thanks!
thanks
You are welcome!
gj!!
you look like luka doncic
Thank you! ;D
min + (max - min)/2 == (min + max)/2
conceptually it is true. But when implemented as (min+max)/2, the result may overflow as we have a permissible range for any datatype. For example, (2147483600+2147483647)/2 would overflow, while 2147483600+(2147483647-2147483600)/2 won't. Mathematically, both are equivalent.
@@pratishbarthwal465 good point