中级农民
- 积分
- 106
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2016-10-9
- 最后登录
- 1970-1-1
|
25天 Goolge onsite 倒计时
12.13 打卡
- 【Longest Common Prefix】find longest common prefix among all input words, sort 或者 trie, O(NklogN) 或者 O(Nk)
- 【Whether a Binary Tree Contains All Chars of a Input String】inorder traversal, 每个节点一个char一个char地check, 17 min
- 【Decoder Iterator】input sequence like [2,4,0,3], it means 2 times of integer 4 and 0 times of integer 3, implement an iterator, 15 min, 多线程则读(hasNext)写(next)锁,两个lock+readCnt
- 【Shortest Path】given an infinite large chess board, start from (0,0) to a destination, some points cannot be visited, 每次跳一个“日”字, shortest path? 双端bfs, 10 min
- 【LC 375 Guess Lower or Higher II】O(N^3) DP, 实际上increasing dq可以达到O(N^2),下次再写一下这个算法,16 min
- 【Longest String Sequence】given a list of strings, 构成串的条件是当前string比parent多一个字符,并且除去最后这一个字符与parent相同, buildGraph (sort by length, Map: string -> Node) + dfs recursive,O(NlogN), 18 min
- 【LC 3 Longest Substring without Repeating Chars】2 pointers + map, 13 min
- 【Max Value of a Complete Tree】LC原题, O(h^2), 8 min
- 【Minimum Cost for IDs】given a list of pairs, each pair has an id and its cost, find K pairs with minimum cost, also one ID cannot be chosen for more than M times, sort + map, 5 min
- 【LC 777 Transfer one String to the Other】RXX -> XRX, O(N) 12 min
|
|