📣 黑五网一特惠|VIP一年通行证5折,蓝莓、Offer多多同步特惠
楼主: guaitt
跳转到指定楼层
上一主题 下一主题
收起左侧

[经验总结] 在职刷题 + System Design + 面试准备的路上

   
🔗
 楼主| guaitt 2018-12-25 12:54:56 | 只看该作者
全局:
12月24日
Leetcode
143. Reorder List : 三部曲:find middle node, reverse after middle node, reorder one by one.
165. Compare Version Numbers
222. Count Complete Tree Nodes: Binary search through depth of left sub and right sub
247. Strobogrammatic Number II
回复

使用道具 举报

🔗
xiaogu1 2018-12-26 12:49:15 | 只看该作者
全局:
楼主速度好快
回复

使用道具 举报

🔗
 楼主| guaitt 2018-12-26 12:58:34 | 只看该作者
全局:
12月25日
Leetcode
159. Longest Substring with At Most Two Distinct Characters: sliding window
202. Happy Number
149. Max Points on a Line: 用slope来判断是否一条直线,用HashMap<Integer, HashMap<Integer, Integer>> 来存储slope(x:y).
187. Repeated DNA Sequences: Two HashSet
246. Strobogrammatic Number
248. Strobogrammatic Number III: DFS
261. Graph Valid Tree: Union Find or DFS. 注意需要check the number of edges == num of nodes -1.
回复

使用道具 举报

🔗
 楼主| guaitt 2018-12-28 13:18:16 | 只看该作者
全局:
12月27日
LeetCode
755. Pour Water: check left, then right.
773. Sliding Puzzle: matrix to string and BFS
239. Sliding Window Maximum: Queue
277. Find the Celebrity: find and check
234. Palindrome Linked List: find middle, reverse, compare
324. Wiggle Sort II: find median, find smaller number and bigger number, reorder
回复

使用道具 举报

🔗
 楼主| guaitt 2018-12-29 12:21:47 | 只看该作者
全局:
12月28日
LeetCode
215. Kth Largest Element in an Array: use quickSort to put bigger numbers into aside and check if this length equals to k. If less, do it again in opposite side with k-n. If more, do it in k numbers.
324. Wiggle Sort II: 1. Find median 2. Put smaller number to the even position 3. Put bigger number to the odd position.
242. Valid Anagram: int array to count
270. Closest Binary Search Tree Value: binary search
281. Zigzag Iterator: use queue to store all iterators
284. Peeking Iterator: cache as peek
285. Inorder Successor in BST: find out the first larger number than target.
282. Expression Add Operators: Backtracking. Edge cases: 1.overflow -> use long 2.multiply need record previous number(current result - pre + pre*cur) 3.only allow one 0 if 0 presents in the first position
回复

使用道具 举报

🔗
 楼主| guaitt 2018-12-30 13:37:44 | 只看该作者
全局:
12月29日
Leetcode
288. Unique Word Abbreviation : Store abbr as the key, word as the value.  If multiple abbreviation in dict, set empty as the value. Then check key and value
298. Binary Tree Longest Consecutive Sequence: Keep track of parent value and current length.
299. Bulls and Cows: array to count
回复

使用道具 举报

🔗
 楼主| guaitt 2018-12-31 12:24:28 | 只看该作者
全局:
12月30日
LeetCode
310. Minimum Height Trees: BFS topological sort.
320. Generalized Abbreviation: Backtracking
316. Remove Duplicate Letters: Stack or recursion.
回复

使用道具 举报

🔗
andy20160507 2018-12-31 13:18:56 | 只看该作者
全局:
佩服!坚持就是胜利!以楼主的勤奋程度,拿牛offer应该只是时间问题。
回复

使用道具 举报

🔗
 楼主| guaitt 2019-1-1 12:48:21 | 只看该作者
全局:
12月31日
LeetCode今天做的几题都非常经典,感觉可以有很多变形,需要理解吃透
317. Shortest Distance from All Buildings: 从每个building来计算到每个点距离(BFS),然后累加所有距离就可以得到当前点到所有building的距离,取最小值。
329. Longest Increasing Path in a Matrix: DFS + Memoization. Time complexity is O(V)
332. Reconstruct Itinerary: DFS or Hierholzer 找欧拉路径
回复

使用道具 举报

全局:
给楼主加个油 这样的功底 这样的毅力 大offer就在眼前
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表