注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
之前发的好像图片附加不进去,重新发一个新的,求加米!
一共两题
第一题有点复杂,edge cases较多
第二题比较简单
work style就跟网上和地里的看到的差不多,youtube上看到一个博主,可以跟着视频一起做一下,锻炼一下自己的思维:
1. Code Question 1
Amazon developers are building a prototype for a regex generator for the given strings. For the prototype version, the regex consists of uppercase English letters, '[' and ']'. Here, a string of characters enclosed in square brackets '[' and ']' matches any of the characters in that string. Also, the string of characters enclosed within '[' and ']' consists of uppercase English letters only with no repetition.
For example:- "[ABBR]ABC" is not a valid regex as B occurs twice between square brackets.
- "[ABC", "A[A[", "]" and "]ABC" are also not valid regexes as brackets must contain some string, and brackets should also form a balanced bracket sequence.
- "[ABC][BCA]" is a valid regex and matches with "BBCA" and "ABCA", but not with "ABBCA".
- "2. Code Question 2
Data analysts at Amazon are analyzing time-series data. It was concluded that the data of the n^th item was dependent on the data of some x^th day if there is a positive integer k such that floor(n / k) = x, where floor(z) represents the largest integer less than or equal to z.
Given n, find the sum of all the days' numbers on which the data of the x^th (0 ≤ x ≤ n) will be dependent.
|