题目1:
A password is considered strong if below conditions are all met:
1. It has at least 6characters and at most 20 characters.
2. It must contain at least one lowercase letter,at leaset one upppercase letter,and at least one digit.
3. It must NOTcontain 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.
题目2:
You are given a string,s, and a list of words,words,that are all of the same length.Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.
Example 1:
Input:
s = "barfoothefoobarman",
words = ["foo","bar"]
Output:[0,9]
Explanation:Substrings starting at index 0 and 9 are"barfoor" and "foobar" respectively.
The output order does not matter,returning [9,0] is fine too.
Example 2:
Input:
s = "wordgoodgoodgoodbestword",
words = ["word","good","best","word"]
Output:[]
最好有代码实现方式,大家一起来挑战吧