We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  1. Practice
  2. Data Structures
  3. Arrays
  4. Left Rotation
  5. Discussions

Left Rotation

  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

    You are viewing a single comment's thread. Return to all comments →

  • vamphonephong 2 years ago+ 0 comments

    I'm failing to see where it actually does a left rotate of an existing array.

    What I'm seeing is (from assumption of ...) array[0..n] is empty initially. getArray[0..n] stores input from stdin. store rotated result into array[0..n].

    The existing array is getArray. That array is still in an unrotated order. The array[0..n] isn't considered the exiting array as it is empty.

    Challenge to you: get rid of getArray array and store input into array[] array. Rotate that array and then print the end result of that array.

    1|
    ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature