码迷,mamicode.com
首页 > 其他好文 > 详细

[LeetCode] Strong Password Checker 密码强度检查器

时间:2016-10-23 02:00:29      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:require   turn   password   insert   condition   ide   write   replace   ons   

 

A password is considered strong if below conditions are all met:

  1. It has at least 6 characters and at most 20 characters.
  2. It must contain at least one lowercase letter, at least one uppercase letter, and at least one digit.
  3. It must NOT contain three repeating characters in a row ("...aaa..." is weak, but "...aa...a..." is strong, assuming other conditions are met).

Write a function strongPasswordChecker(s), that takes a string s as input, and return the MINIMUM change required to make s a strong password. If s is already strong, return 0.

Insertion, deletion or replace of any one character are all considered as one change.

 

s

 

[LeetCode] Strong Password Checker 密码强度检查器

标签:require   turn   password   insert   condition   ide   write   replace   ons   

原文地址:http://www.cnblogs.com/grandyang/p/5988792.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!