Coding Challenge #6: Array Rotation JavaScript Coding Challenge For Beginners

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Please like, share and subscribe if you find the video useful.
    Checkout the Playlists:
    👉 FrontEnd JavaScript Interview Questions: • #4 JavaScript Intervie...
    👉 JavaScript Tutorials:
    • Difference Between var...
    👉 Essentials for Web developers:
    • How Does the Browser C...
    👉 React Hooks & Latest concepts:
    • Rules of Hooks In Reac...
    👉 HTML Tutorials:
    • WebStorage APIs Sessio...
    👉 CSS Tutorials:
    • How Does CSS Work | Th...
    👉 Coding Challenges:
    • Coding Challenge #5: A...
    👉 Best Practices & Common mistakes:
    • Best Practices of Usin...
    👉 React js for Beginners:
    • Why To Use JSX in Reac...
    👉 Things To Know As JavaScript/FrontEnd Developer:
    • Things To Know As Java...
    LIKE | SHARE | SUBSCRIBE 😊
    #javascript #reactjs #react #webdevelopment #frontenddevelopment #uidevelopment
    #javascriptinterviewquestions #interviewquestions #codingchallenges
    👇👇👇
    Follow me on
    Telegram: t.me/+HTxs0I-J...
    Instagram: / rethinkingui
    Twitter: / suresh9058
    LinkedIn: / suresh-mende-a1a20459
  • Věda a technologie

Komentáře • 31

  • @mohanraja1350
    @mohanraja1350 Před 10 měsíci +2

    you explained the method by using splice wonderfully, its really pleasure to learn with you thank you

  • @Ajishshandilya
    @Ajishshandilya Před rokem +1

    for the first approach in leetcode it is showing the error of TLE(Time Limit Exceed)
    and for 2nd it will fail in the below scenario.
    take these inputs
    let arr = [1,2];
    let k = 5;
    expected O/p is [2,1]
    actual O/P is [1,2]

  • @anujadi8366
    @anujadi8366 Před rokem +2

    Very well explained

  • @bosin4035
    @bosin4035 Před rokem +1

    Thank you for the detailed solution.

  • @kumar7163
    @kumar7163 Před rokem +1

    Thanks bro

    • @RethinkingUI
      @RethinkingUI  Před rokem

      Please Do Like Share And Subscribe...🙂🙂🙂

  • @jtech5795
    @jtech5795 Před 3 lety +1

    Explained Well.
    Thank You

  • @jiggabytes
    @jiggabytes Před 2 lety +1

    Hi, when I use the 2nd solution with splice, the test case arr = [1,2] arrayRotation = 1, it fails and I am not sure why.

    • @codingismyreligion
      @codingismyreligion Před 2 lety

      It's because when you see and k is longer than nums you will get a negative value and be trying to delete values at an index that doesn't exist.
      This video is from May 2021 and Leet Code must have updated the problem with some new test cases.

  • @vinothkumarn4780
    @vinothkumarn4780 Před 2 lety +1

    A very good explanation. Thanks buddy!

    • @RethinkingUI
      @RethinkingUI  Před 2 lety

      Thank u

    • @vinothkumarn4780
      @vinothkumarn4780 Před 2 lety

      @@RethinkingUI could you please explain rotate array not using pop and other methods. Instead, only using while loop and for loops. And saving in temp variable.

    • @vinothkumarn4780
      @vinothkumarn4780 Před 2 lety

      @@RethinkingUI I mean, help me understand the following code.
      let arr=[1,2,3,4,5,6,7];
      let k=3;
      let count=0;
      let val=arr[0];
      let rep=0;
      let i=0;
      while(count

  • @pratikshaandsaurabhwedding7466

    Very well explained brother

  • @theone-pq9tp
    @theone-pq9tp Před 3 lety +1

    Thanks bhai

  • @irkfaisal
    @irkfaisal Před 2 lety +1

    Can you tell me the methods for rotating it in left direction (to last position of an array).

    • @RethinkingUI
      @RethinkingUI  Před 2 lety

      Try Array shift method

    • @irkfaisal
      @irkfaisal Před 2 lety +1

      @@RethinkingUI yes it worked array.push(array.shift());
      Thanks i understand this rotation array logics. Very simple

  • @mrnabby4178
    @mrnabby4178 Před rokem +1

    sahi dimaag lagaya bhai.

  • @anurag5362
    @anurag5362 Před rokem

    thank u bro but how to solve without inbuilt function ?

  • @irkfaisal
    @irkfaisal Před 2 lety +1

    Why the console final output is underfined.

    • @RethinkingUI
      @RethinkingUI  Před 2 lety

      final output console is the console which we are calling the function. As that function not returning anything. We got the final console output as undefined. In fact we no need to put the function call in the console log.

    • @irkfaisal
      @irkfaisal Před 2 lety +1

      @@RethinkingUI yes after i return the function i got solved

  • @mahendrapaswan3496
    @mahendrapaswan3496 Před 2 lety +1

    Nice concept