最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Leetcode 2299. Strong Password Checker II

2023-02-15 15:09 作者:您是打尖兒還是住店呢  | 我要投稿

A password is said to be?strong?if it satisfies all the following criteria:

  • It has at least?8?characters.

  • It contains at least?one lowercase?letter.

  • It contains at least?one uppercase?letter.

  • It contains at least?one digit.

  • It contains at least?one special character. The special characters are the characters in the following string:?"!@#$%^&*()-+".

  • It does?not?contain?2?of the same character in adjacent positions (i.e.,?"aab"?violates this condition, but?"aba"?does not).

Given a string?password, return?true?if it is a?strong?password. Otherwise, return?false.

?

Example 1:

Input: password = "IloveLe3tcode!"Output: trueExplanation: The password meets all the requirements. Therefore, we return true.

Example 2:

Input: password = "Me+You--IsMyDream"Output: falseExplanation: The password does not contain a digit and also contains 2 of the same character in adjacent positions. Therefore, we return false.

Example 3:

Input: password = "1aB!"Output: falseExplanation: The password does not meet the length requirement. Therefore, we return false.

?

Constraints:

  • 1 <= password.length <= 100

  • password?consists of letters, digits, and special characters:?"!@#$%^&*()-+".

針對(duì)于每個(gè)限制條件寫一個(gè)方法,最終合并;

Runtime:?1 ms, faster than?81.19%?of?Java?online submissions for?Strong Password Checker II.

Memory Usage:?40.3 MB, less than?73.13%?of?Java?online submissions for?Strong Password Checker II.


Leetcode 2299. Strong Password Checker II的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
霍山县| 股票| 磐安县| 东源县| 蚌埠市| 家居| 日土县| 台湾省| 屏东市| 隆尧县| 怀宁县| 萨嘎县| 灵丘县| 宁化县| 郁南县| 重庆市| 德兴市| 肇州县| 金溪县| 宣化县| 略阳县| 襄樊市| 洮南市| 石楼县| 牟定县| 台南市| 繁峙县| 甘孜县| 佳木斯市| 鸡东县| 新乡县| 视频| 和林格尔县| 民丰县| 郓城县| 乌鲁木齐市| 博客| 新平| 洞头县| 怀化市| 加查县|