Question: a company changes passwords for its system every month by rotating the previous months password by a certain number of characters. However errors may occur
a company changes passwords for its system every month by rotating the previous months password by a certain number of characters. However errors may occur resulting in a new password that isint a valid rotation of the old one. The security analysts of the company nedd to figure out how many minimum rotations on which direction left or right are needed to change the old password into a new password. Help them determine the minimum number of rotations along with the direction of rotation needed to changethe old password into new password.Given two words representing oldpassword and newpassword. If the number of left rotations are equal to the right rotations then print only the number of rotations. Otherwise print the minimum number of rotations along withthe direction of rotation.If the newpassword is not a valid rotation of oldpassword print false.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
