## 帐号 密码 自动登录 找回密码 注册账号
 搜索

# ebay OA

|只看干货 | 地里的匿名用户  发表于 2020-9-20 22:31:46 |阅读模式
 本楼： 👍   100% (1) 0% (0)   👎

2019(7-9月) 码农类General 硕士 实习@eBay - 网上海投 - Onsite  | Other | fresh grad应届毕业生

### 注册一亩三分地论坛，查看更多干货！

x

constructorNames，题目:
Overview

goodTuples
Give an array and find the count of a pair number and a single number combination in a row of this array. Target array is a[ i - 1], a[ i], a[ i + 1]
Input: a = [1, 1, 2, 1, 5, 3, 2, 3]
Output: 3
Explain:
[1, 1, 2] -> two 1 and one 2(O)
[1, 2, 1] -> two 1 and one 2(O)
[2, 1, 5] -> one 2, one 1 and one five(X)
[1, 5, 3] -> (X)
[5, 3, 2] -> (X)
[3, 2, 3] -> (O)

Time: O(n)

divisorSubstrings
Give a number n and digit number k find all serial substring is able to divisible n.
Input: n = 120, k = 2
Output: 2
Explain:
120 -> 12 and 20
120 % 12 == 0 (O)
120 % 20 == 0 (O)

Input: n = 555, k = 1;
Output: 1
Explain:
555 -> 5, 5 and 5 (Duplicate so only count one 5)
555 % 5 == 0 (O)

Input: n = 2345, k = 2
Output: 0
Explain:
2345 -> 23, 34, 45
2345 % 23 != 0 (X)
2345 % 34 != 0 (X)
2345 % 45 != 0 (X)

Time: O(n)

constructorNames
Give two String a and b find the is there any possible to repalce the same frequency character
Input: a = babczzz, b = abbzccc
Output: true
Explain:
In a string,
a -> 1, b -> 2, c-> 1, z -> 3
In b string,
a -> 1, b -> 2, c -> 3, z -> 1
a and b are the same frequency.
c and z have same frequency so they can replace to each other.
So return true.

Input: a = x, b = y
Output: false
Explain: Not the same character

Input: a = ii, b = j
Output: false
Explain: length is different.

Time: Unknow, I didn’t solve it. But I assume it will be O(n).

coolFeature
Give three array a , b and query . This one is hard to explain. Just read the example.
Input:
a = [1, 2, 3]
b = [3, 4]
query = [[1, 5], [1, 1 , 1], [1, 5]]

Output:
[2, 1]

Explain:
Just ignore every first element in sub array in query.
So we will get a new query like this query = [, [1, 1], ]
Only record the result when meet the single number in new query array.
And the rule of record is find the sum of the single number.
The example above is 5 = 1 + 4 and 5 = 2 + 3 , there are two result.
So currently the output is 
When we meet the array length is larger than 1, such as [

### 评分 siwen0826 2020-9-28 11:17:26 | 显示全部楼层
 本楼： 👍   100% (1) 0% (0)   👎 全局： 👍   100% (94) 0% (0)    👎
 可以求问一下从发oa多久ddl吗？14天？ 谢谢楼主 地里的匿名用户  发表于 2020-9-21 04:05:57
 本楼： 👍   0% (0) 0% (0)   👎
 老哥第四题没做出来他给了多少分啊（overall）不知道扣分和小题分数是不是线性的？ jessyyilin 2020-9-28 12:42:05 来自一亩三分地官方APP | 显示全部楼层
 本楼： 👍   0% (0) 0% (0)   👎 全局： 👍   92% (13) 7% (1)    👎
 请问楼主是什么时候投的呢？