CodeChef Starters 165 (Div 4) | Video Solutions | Smart Interviews

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 10

  • @komal-xl7ps
    @komal-xl7ps 12 днів тому +1

    This is wonderful series....you teach us with crystal clear explanation...!!! but explain us remaing questions as well...

    • @SmartInterviews
      @SmartInterviews  11 днів тому +1

      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!

    • @komal-xl7ps
      @komal-xl7ps 11 днів тому +1

      @SmartInterviews sir... please explain solution of all the questions in coding contst of codechef.

  • @rohitfasale1377
    @rohitfasale1377 10 днів тому +1

    Great explanation ❤ every time I am waited for the explanations videos from you 😊

    • @SmartInterviews
      @SmartInterviews  9 днів тому

      We're glad you found the explanation helpful 🙌. Stay tuned for more content like this! 😊

  • @Tejesh-t1t
    @Tejesh-t1t 15 днів тому +1

    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)

    • @komal-xl7ps
      @komal-xl7ps 12 днів тому +1

      hey.. I am beginner in CP ....is sir makes only 3,4 questions video on each time?

    • @Tejesh-t1t
      @Tejesh-t1t 12 днів тому

      @ there are only 3,4 questions in a contest

    • @komal-xl7ps
      @komal-xl7ps 12 днів тому

      @@Tejesh-t1t No....I think 6 questions in actual contest

    • @Tejesh-t1t
      @Tejesh-t1t 12 днів тому +1

      @@komal-xl7ps yea but only 3,4 of them are worth discussing.