我运气比较好,出现的4个全是easy…真是枉费我辛苦准备了2天……
一共四个题目
- Balanced Sales Array
- Sub Palindrome
- Coloring the Blocks
- Unique Twitter User Id Set
下面是我整理的约20道OA的题,我感觉题库基本就这些了~在LC上有讨论的,我会贴原链接/原题,没有的我就大概写个解题思路。
1. Twitter new office design
貌似是道数学题… https://leetcode.com/discuss/int … r-New-Office-Design
2. Efficient Job Processing
经典的0/1背包问题,用DP解: https://leetcode.com/discuss/int … -Processing-Service
3. Game Event
https://leetcode.com/discuss/int … 2019-or-Game-Events
4. Unique Twitter User Id Set
https://leetcode.com/discuss/int … Twitter-User-Id-Set
5. Partitioning Array
主要是判断1. len(numbers)%k !=0; 2. 是否有元素的个数> len(numbers)//k: https://leetcode.com/discuss/int … -Partitioning-array
6. Autoscale Policy
https://leetcode.com/discuss/int … or-Autoscale-Policy
7. Authentication Token
https://leetcode.com/discuss/int … thentication-Tokens
8. K difference
LC伍叁贰
9. Buying show tickets
(这是唯一一个我们找到原题的…不好意思…)
10. Weird Faculty
https://leetcode.com/discuss/int … 19-or-Weird-Faculty
11. Final discounted price
LC齐三久 变种
12. Reaching Points
LC岐拔灵 原
13. twitter social network
LC吴思琪 原
14.Activate fountain
算是greedy里比较经典的区间覆盖问题,可以转化成interval以后sort: https://leetcode.com/discuss/int … r-Activate-Fountain
15. Coloring the blocks
LC而物流 原
16. Parking Dilemma
这个题LC讨论里的图非常不清楚,不过好像不难,用sliding window就好: https://leetcode.com/discuss/int … -or-Parking-Dilemma
17. Get set on
LC似时 变种 不需要求全部可能,所以可以用set
18. Sub Palindrome
LC刘思琪 变种 需要找到unique substring,额外加一个set()检查一下就好
19.Restocking the Warehouse
这个不难…遍历一下就好
20.Balanced Sales Array
这个也不难,也是遍历就好
21. university career fair
https://leetcode.com/discuss/int … versity-Career-Fair
22. Anagram Difference
Hacker上的题: https://www.hackerrank.com/challenges/anagram/problem