Question: Question A competitive programming site Programming Hunt is going to organize a programming competition. To participate in the competition, a user must register on the
Question
A competitive programming site Programming Hunt is going to organize a programming competition. To participate in the competition, a user must register on the site. When a user registers, the system automatically generates a password using the first and last name of the user. To generate a password, the system creates a string of length from the distinct common characters in both the first and last name. The password that is formed must consist the characters in alphabeticanorder.
Write an algorithm to find all the possible passwords that the system can generate for a given user.
Input
The first line of the input consists of a string firstName, representing the first name of the user.
The second line of input consists of a string lastName, representing the last name of the user.
The third line of input consists of an integer passwordLength, representing the length of the password L
Output
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
