Summary
Keywords
Full Transcript
Question Name: Rotate a number Question Link: https://nados.io/question/rotate-a-number Question Statement: 1. You are given two numbers n and k. You are required to rotate n, k times to the right. If k is positive, rotate to the right i.e. remove rightmost digit and make it leftmost. Do the reverse for negative value of k. Also k can have an absolute value larger than number of digits in n. 2. Take as input n and k. 3. Print the rotated number. 4. Note - Assume that the number of rotations will not cause leading 0's in the result. e.g. such an input will not be given n = 12340056 k = 3 r = 05612340 -------------------------------------------------------------------------------------------------------------------------------------------------------------- Please consume this content on nados.io for a richer experience. It is necessary to solve the questions while watching videos, nados.io enables that. NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the solution where we are required to rotate a number by any integer and then print the rotated number. To revisit the question, click here: https://www.youtube.com/watch?v=ysMHtDIlU0c&list=PL-Jc9J83PIiFj7YSPl2ulcpwy-mwj1SSk&index=25 -------------------------------------------------------------------------------------------------------------------------------------------------------------- Pepcoding has taken the initiative to provide counselling and learning resources to all curious, skillful and dedicated Indian coders. This video is part of the series to impart industry-level web development and programming skills in the community. For better experience and well organized free resources visit - https://nados.io/content/data-structures-and-algorithms We also provide professional courses with live classes and placement opportunities. DSA Level 1 and Level 2 https://www.youtube.com/c/Pepcoding/playlists?view=50&sort=dd&shelf_id=4 Here is a roadmap to our Free study content and know more about our resources here - https://nados.io/content/data-structures-and-algorithms We are also available on the following social media platforms: - Facebook(Meta) - https://www.facebook.com/pepcoding Instagram - https://www.instagram.com/pepcoding LinkedIn - https://www.linkedin.com/company/pepc... Pinterest - https://in.pinterest.com/Pepcoding/_c... Twitter - https://twitter.com/pepcoding Youtube (English Channel)- https://www.youtube.com/channel/UCc32cBloOW_Xh_ccJymTM8Q Also take a look at our placement assistance - https://www.pepcoding.com/placements HAPPY PROGRAMMING! Pep it up..... Hashtags #java #javafoundation #rotateanumber
