We're thrilled you're enjoying the series 😊. We’re aiming for the best, clear discussions on a variety of questions, and we’ll make sure to cover everything in detail! Stay tuned for more insightful content!
We can solve the second question in O(1) time complexity by exploiting the property that the perimeter of a rectangle is always even. If the value of k is odd, we simply print 1 since the perimeter can never be odd. If the perimeter is even, we print 0 because we can always reduce the maximum perimeter to k by decreasing the length and width, as long as both remain greater than 1. The obvious edge cases are: When k is greater than the maximum perimeter, print k - maximum perimeter. When k ≤ 4, print maximum perimeter - k. Here is my python code for it: tc=int(input()) for i in range(tc): x,y,z=map(int,input().split()) if 2*(x+y)
This is wonderful series....you teach us with crystal clear explanation...!!! but explain us remaing questions as well...
We're thrilled you're enjoying the series 😊. We’re aiming for the best, clear discussions on a variety of questions, and we’ll make sure to cover everything in detail! Stay tuned for more insightful content!
@SmartInterviews sir... please explain solution of all the questions in coding contst of codechef.
Great explanation ❤ every time I am waited for the explanations videos from you 😊
We're glad you found the explanation helpful 🙌. Stay tuned for more content like this! 😊
We can solve the second question in O(1) time complexity by exploiting the property that the perimeter of a rectangle is always even. If the value of k is odd, we simply print 1 since the perimeter can never be odd. If the perimeter is even, we print 0 because we can always reduce the maximum perimeter to k by decreasing the length and width, as long as both remain greater than 1.
The obvious edge cases are:
When k is greater than the maximum perimeter, print k - maximum perimeter.
When k ≤ 4, print maximum perimeter - k.
Here is my python code for it:
tc=int(input())
for i in range(tc):
x,y,z=map(int,input().split())
if 2*(x+y)
hey.. I am beginner in CP ....is sir makes only 3,4 questions video on each time?
@ there are only 3,4 questions in a contest
@@Tejesh-t1t No....I think 6 questions in actual contest
@@komal-xl7ps yea but only 3,4 of them are worth discussing.