注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
我投的国内的亚麻,笔试一共2题,做的时候显示accept,但是目前仍无进展,也没有收到拒信。求大米,谢谢!
第一题:
Your team at Amazon has recently adopted a new password validation scheme for internal user accounts.
A password consists of lowercase English letters only and is valid only if it contains at least one vowel and at least one consonant. Vowels are the characters 'a','e','i','o','u'. The rest are consonants. The strength of a password is defined as the maximum number of contiguous subsegments the entire password can be devided into such that each subsegment us a valid password.
. 1point3acres.com Given a pasword string, find its strength. Return 0 if the password itself is not valid.
Note: a subsegment of a string is a segment composed of contiguous characters of the original string, taken in the same order.
Example:
password="hackerrank"
output:3
第二题:. 1point 3acres
The Amazon Kindle Store is an online e-book store where readers can choose a book from a wide range of categories. It also provides the ability to bookmark pages the user wishes to return later. A book is represented as a binary string having two types of pages:. 1point 3 acres
(1) '0': an ordinary page
(2)'1': a bookmarked page
Find the number of ways to select 3 pages in ascending index order such that no two adjacent selected pages are of the same type..--
Example:
book:'01001'
The following sequences of pages match the criterion:
[1,2,3],[1,2,4],[2,3,5],[2,4,5]
The answer is 4. |