注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
某贝面经
First Question:
Input: an integer n
Output: an integer representing the result
how: process all digit of integer n in order of plus and minus
example: Given 12345
Return 3
explain: 1 - 2 + 3 - 4 + 5 = 3
Second Question:
Input: a list of integer
Output: a list of integer
how: return the most frequent digit in the list
Example: Given [312, 3, 55, 652, 23]
Return: [2, 3, 5]
Explain: There are three 2, 3 and 5, which are the most frequent digits.
Third Question:
Inputi] * A[i] + B[j] * B[j] <= upper
How: count how many possible outcomes in total
Exmaple: A[3, -1, 9], B[100, 5, -2], lowerBound = 7, upperBound = 99
Return: 4
Explain: When combination of [i, j] is [0, 1], [0, 2], [1, 1], [2, 2], the outcome satisfiy.
[/i][/i][/i] |