Check if Array Is Sorted and Rotated | Leetcode 1752

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

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

  • @freecourseplatformenglish2829
    @freecourseplatformenglish2829 วันที่ผ่านมา +1

    Keep it up man. Solved it on my own it was an easy question.
    Really appreciate your commitment to post solution daily.

    • @techdose4u
      @techdose4u  22 ชั่วโมงที่ผ่านมา +1

      yepp it was easy :)
      hence was being lazy to post

  • @i.vigneshdavid1698
    @i.vigneshdavid1698 วันที่ผ่านมา +2

    Nice explanation
    1)If the array is rotated, there is only one point where a[i-1]>a[i].
    2)If the arrays is sorted and not rotated then a[n-1] > a[0].
    One we just iterate the array and increase the counter if the first condition satisfies .
    Now check second condition, if it satisfies increment counter.
    Finally return counter

    • @techdose4u
      @techdose4u  วันที่ผ่านมา +2

      Great :)

    • @SSR0108
      @SSR0108 49 นาทีที่ผ่านมา +1

      Great approach

  • @divyanshugupta4266
    @divyanshugupta4266 วันที่ผ่านมา +1

    Amazing And Thanks 😀😀😀

    • @techdose4u
      @techdose4u  วันที่ผ่านมา

      Most welcome 😊

  • @tejaschavan007
    @tejaschavan007 วันที่ผ่านมา

    waited, and finally 🎉

    • @techdose4u
      @techdose4u  วันที่ผ่านมา

      Nice :)
      It will come everyday

  • @bunnybhonagiri
    @bunnybhonagiri วันที่ผ่านมา

    nice sir...thankyou

    • @techdose4u
      @techdose4u  วันที่ผ่านมา

      Welcome 🙏🏼