楼主: QAQ555
跳转到指定楼层
上一主题 下一主题
收起左侧

一个月刷完300tag

🔗
 楼主| QAQ555 2019-12-26 13:56:16 | 只看该作者
全局:
小放了个假~ 明天开始10+!

dec 24 25

[348. Design Tic-Tac-Toe] 原来如此 的感觉
[472. Concatenated Words]
[346. Moving Average from Data Stream]
[114. Flatten Binary Tree to Linked List]
[720. Longest Word in Dictionary]
pramp 一道easy 题~

看了几部电影 吃了几顿大餐 唱了两场k 我也太滋润了。。。
回复

使用道具 举报

🔗
 楼主| QAQ555 2019-12-27 13:23:09 | 只看该作者
全局:
dec 26 干活!

今天pramp印度大哥教我写了一道很有意思的动规

[824. Goat Latin] 无聊的写easy题

[13. Roman to Integer] 和前者对比 大了减去两倍 IV

[339. Nested List Weight Sum] recursive

[208. Implement Trie (Prefix Tree)] trie

[146. LRU Cache]  用 double linked list + map,每次更新(先移除)或者添加 就在头部加,超过capacity 移尾巴
回复

使用道具 举报

🔗
 楼主| QAQ555 2019-12-29 14:53:53 | 只看该作者
全局:
dec 27 28
pramp了一道two sum。。。 教人写了dp。。

[239. Sliding Window Maximum] 用 deque 装index

[124. Binary Tree Maximum Path Sum] 用一个global sum,和recursive cur+ max(0,left) + max(0,right)

[109. Convert Sorted List to Binary Search Tree] 找mid 用 fast slow 指针, 判断几个可能 null

[108. Convert Sorted Array to Binary Search Tree] 直接送start 和 end 给 left 和right

[105. Construct Binary Tree from Preorder and Inorder Traversal] 找规律 preorder 和 inorder

[708. Insert into a Sorted Circular Linked List] 三个case

[652. Find Duplicate Subtrees] serialize 或者标写id

[428. Serialize and Deserialize N-ary Tree] 标记有几个children 以及for loop

[449. Serialize and Deserialize BST] 利用binary tree的特性,有range peek下超出range 先不管

[297. Serialize and Deserialize Binary Tree] dfs/bfs
回复

使用道具 举报

🔗
 楼主| QAQ555 2019-12-29 14:54:27 | 只看该作者
全局:
对了还写了contest 写出了三道!最后一题写了很久还是写不出来。。。
回复

使用道具 举报

🔗
 楼主| QAQ555 2019-12-31 01:51:03 | 只看该作者
全局:
dec 29

[872. Leaf-Similar Trees] 用 list 存起来 再compare

[112. Path Sum]用sum 减去 每次node的值,当该node 左右都为空,判断是否rest 为0

[104. Maximum Depth of Binary Tree] 为空返回0 不会空取max + 1

[110. Balanced Binary Tree] 不balance 返 -1 大于 1 返 -1,保证子子树也要balance

[100. Same Tree] 要空一起空,不空false 子树也得是sametree

[101. Symmetric Tree] 两个两个检查

[111. Minimum Depth of Binary Tree] bfs

[794. Valid Tic-Tac-Toe State] 好像跑不过?

[248. Strobogrammatic Number III] 套用2 的方法

[938. Range Sum of BST] 根据当前点的大小,如果比left 大 走左边,如果比right 小 走右边,用global sum,返回空

[239. Sliding Window Maximum] 用deque

pramp 1道题.。。easy
回复

使用道具 举报

🔗
 楼主| QAQ555 2020-1-2 13:08:19 | 只看该作者
全局:
dec 30 31 1

[191. Number of 1 Bits]
[82. Remove Duplicates from Sorted List II]
[83. Remove Duplicates from Sorted List]
[494. Target Sum]
[40. Combination Sum II]
[39. Combination Sum]
[200. Number of Islands]
[47. Permutations II]
[46. Permutations]
[4. Median of Two Sorted Arrays]
[733. Flood Fill]

会了回溯法 挂了三个面试 。。。 希望2020年顺利点吧
回复

使用道具 举报

🔗
 楼主| QAQ555 2020-1-4 01:42:44 | 只看该作者
全局:
jan 02

[304. Range Sum Query 2D - Immutable] presum 图形

[303. Range Sum Query - Immutable] presum

[408. Valid Word Abbreviation] 模拟法

[266. Palindrome Permutation] 直接看个数

[26. Remove Duplicates from Sorted Array]比较 前移

[414. Third Maximum Number] 最小queue

[28. Implement strStr()] two pointer / substring

[785. Is Graph Bipartite?] 上色

[133. Clone Graph] dfs + map node 对 clone 每次加上neighbor
回复

使用道具 举报

🔗
 楼主| QAQ555 2020-1-4 23:32:43 | 只看该作者
全局:
jan 03 ood +

[55. Jump Game] backtracking slow/ greedy start from the tail

[90. Subsets II] 比较

[78. Subsets] backtracking

[71. Simplify Path] 从后往前找,空/ 忽略,. 忽略,.. 计数,可抵消,否则inserst at 0

[636. Exclusive Time of Functions] 用一个stack 每次有start/end 更新 time

[405. Convert a Number to Hexadecimal] 32位 每次移动28,24.。。0,和1111 &,注意如果sb 为空,且与结果为0 不 append

[1268. Search Suggestions System] trie里每个node 加 priorityqueue

[17. Letter Combinations of a Phone Number] backtracking  但不需要loop from start,只有与顺序无关才从头loop

[79. Word Search] 找到一点发散,注意set加上使用过的

[211. Add and Search Word - Data structure design] trie

[394. Decode String] backtrack / recursion
回复

使用道具 举报

🔗
 楼主| QAQ555 2020-1-5 23:57:04 | 只看该作者
全局:
jan 04

[739. Daily Temperatures] stack 巧用peek

[161. One Edit Distance] 分长度

[496. Next Greater Element I] 上上题简化版本

[987. Vertical Order Traversal of a Binary Tree] 用一个inner class 对比 314 用两个queue

[51. N-Queens] backtracking 不难

打了lc 做出两题,一个ood
回复

使用道具 举报

🔗
 楼主| QAQ555 2020-1-6 23:14:22 | 只看该作者
全局:
jan 05

ood 一份

[223. Rectangle Area] 面试不会做的题当然要会坐啦!

[836. Rectangle Overlap] easy version

[547. Friend Circles] dfs

[412. Fizz Buzz] eassy

[1311. Get Watched Videos by Your Friends] 终于会了

[85. Maximal Rectangle] 考我可能挂了

[221. Maximal Square] 会了

[286. Walls and Gates] 昨天做的其实
回复

使用道具 举报

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

本版积分规则

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