Valid Palindrome II Leetcode in Telugu | DSA in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

ความคิดเห็น • 2

  • @abhilashg1368
    @abhilashg1368 7 หลายเดือนก่อน

    Bro, Time complexity for your python code is O(n^2), string slicing will take average of O(n) time complexity, and while loop will take O(n), so total is O(n^2), malli interview lo enduku select avvaledu ani doubt rakudadu ani ikkada comment chestunna.
    O(n) time complexity ravali ante oka helper function rasukoni pass string and indexes to check substring is palindrome. Ee video lo unna specific code time complexity is O(n^2).

    • @techwithsaketh
      @techwithsaketh  7 หลายเดือนก่อน

      string sliciing only one time ae chestham kadha bro motham while loop lo .n times string slicing chesthe appudu n^2 time complexity iyidhi kadha. So aa logic tho O(N) anna . Ee logic wrong iythe text me. Change chestha . Thanks for your response by the way 😊