A password is considered strong if the below conditions are all met: • It has at least 6 characters and at most 20 characters. • It contains at least one lowercase letter, at least one uppercase letter, and at least one digit. • It does not contain three repeating characters in a row (Le., "...aaa..." is weak, but "..aa..a..." is strong, assuming other conditions are met). Given a string password, return the minimum number of steps required to make password strong. if password is already strong, return e. In one step, you can: • Insert one character to password, • Delete one character from password, or • Replace one character of password with another character. Example 1: Input: password - Output: 5

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
icon
Related questions
Question

Computer Engineering Lab

A password is considered strong if the below conditions are all met:
• It has at least 6 characters and at most 2e characters.
• It contains at least one lowercase letter, at least one uppercase letter, and at least one digit
• It does not contain three repeating characters in a row (Le. "...aaa..." is weak, but
is strong, assuming other conditions are met).
Given a string password, retum the minimum number of steps required to make password strong. if password is aiready strong, return e.
In one step, you can:
• Insert one character to password,
• Delete one character from password, or
• Replace one character of passMard with another character.
Example 1:
Input: pasSword -
Output: 5
Example 2:
Transcribed Image Text:A password is considered strong if the below conditions are all met: • It has at least 6 characters and at most 2e characters. • It contains at least one lowercase letter, at least one uppercase letter, and at least one digit • It does not contain three repeating characters in a row (Le. "...aaa..." is weak, but is strong, assuming other conditions are met). Given a string password, retum the minimum number of steps required to make password strong. if password is aiready strong, return e. In one step, you can: • Insert one character to password, • Delete one character from password, or • Replace one character of passMard with another character. Example 1: Input: pasSword - Output: 5 Example 2:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT