📣 Back to School开学季 - VIP通行证5折优惠!蓝莓、Offer多多同步优惠
楼主: clairefig
跳转到指定楼层
上一主题 下一主题
收起左侧

纽约在职刷题

🔗
 楼主| clairefig 2019-9-5 23:40:12 | 只看该作者
全局:
399. Evaluate Division. Graph building and bfs.

75. Sort Colors. Two pointers, three indices Dutch national flag / partition sort.

补充内容 (2019-9-6 01:58):
309. Best Time to Buy and Sell Stock with Cool Down. Dynamic programming as a state transition machine. State/ subproblems, and transition matrix.

补充内容 (2019-9-6 01:58):
309. Best Time to Buy and Sell Stock with Cool Down. Dynamic programming as a state transition machine. State/ subproblems, and transition matrix.

补充内容 (2019-9-6 02:24):
300. Longest Increasing Subsequence. Binary Search with Dynamic Programming

补充内容 (2019-9-6 08:38):
58. Length of Last Word. 竟然没写出pythonic的写法。用linear scan reverse扫了一遍。

补充内容 (2019-9-6 08:55):
66. Plus One. 类似58。这些早期Easy收获这么多dislikes

补充内容 (2019-9-6 09:21):
69. Sqrt(x). Binary Search, Newton's method, bit manipulation.

补充内容 (2019-9-6 09:22):
83. Remove Duplicates from Sorted List. 怎么移除Linked List的Node

补充内容 (2019-9-6 09:36):
100. Same Tree. Binary tree recursion.

补充内容 (2019-9-6 09:52):
107. Binary Tree Level Order Traversal II. 跟102一模一样的题。一个是easy,一个是medium. LeetCode看来也是有点混乱。BFS on tree.

补充内容 (2019-9-6 10:05):
110. Balanced Binary Tree. Recursive. 用-1记录深度函数得出的一个不平衡的状态

补充内容 (2019-9-6 10:15):
112. Path Sum. Binary Tree DFS. 注意base case的写法。

补充内容 (2019-9-6 10:22):
119. Pascal's Triangle II. DP。用list comprehension可以更Pythonic.
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-6 23:29:50 | 只看该作者
全局:
本帖最后由 clairefig 于 2019-9-6 23:37 编辑

157. Read N Characters Given Read4.

168. Excel Sheet Column Title. 减去1的trick来对付从1开始而不是从零开始。或者给residual分类处理。

170. Two Sum III Data Structure Design.

172. Factorial Trail Zero. Quant的脑筋急转弯问题变成编程题。

14. Longest Commom Prefix. Vertical Scan加上一个pre sort based on Len.





补充内容 (2019-9-7 03:25):
202. Happy Number. 有时候不需要过度优化。存int在set里面。

补充内容 (2019-9-7 04:16):
819. Most Common Word. String上的一些library function操作。

补充内容 (2019-9-7 04:24):
509. Fibonacci Number. Golden ratio formula.

补充内容 (2019-9-7 04:43):
415. Add Strings. 不用int,在单一digit上用ord减去ord('0')
回复

使用道具 举报

🔗
goatKnighttt 2019-9-7 11:20:05 | 只看该作者
全局:
楼主想去哪里工作?我在fintech上班刷题想转纯tech。。。
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-7 22:11:01 | 只看该作者
全局:
goatKnighttt 发表于 2019-9-7 11:20
楼主想去哪里工作?我在fintech上班刷题想转纯tech。。。

楼主看来看去觉得现在去TECH最合适自己的情况了
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-8 02:25:22 | 只看该作者
全局:
本帖最后由 clairefig 于 2019-9-8 02:53 编辑

1165. Single Row Keyboard. Dict

709. To Lower Case. String Library

977. Squares of a Sorted Array.  Smart linear scan.

852. Peak Index in a Mountain Array.

1108. Defanging an IP address. 好多string的基本操作

965. Univalued Binary Tree

346. Moving Average from Data Stream
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-10 01:25:44 | 只看该作者
全局:
本帖最后由 clairefig 于 2019-9-10 01:53 编辑

359. Logger Rate Limiter.

1047. Remove All Adjacent Duplicates In String. Stack

1170. Compare Strings by Frequency of the Smallest Character. String上的min, count等等library functions.

243. Shortest Word Distance.

252. Meeting Rooms. Sort. operator.itemgetter()

268. Missing Number. XOR. X^X = 0, X^0 = X

350. Intersection of Two Arrays II. Sort or dict/ counter based solutions.

836. Rectangle Overlap. Variation of Interval Overlap

551. Student Attendance Record I. Linear Scan vs using library

231. Power of Two. x & (x-1) == 0 or x ^ (-x) == x if x != 0

849. Maximize Distance to Closest Person.







补充内容 (2019-9-10 03:03):
724. Find Pivot Index. Partial Sum.

补充内容 (2019-9-10 03:55):
205. Isomorphic Strings. One to One and Onto

补充内容 (2019-9-10 04:10):
941. Valid Mountain Array

补充内容 (2019-9-10 08:40):
374. Guess Number Higher or Lower. Binary Search

补充内容 (2019-9-10 08:56):
299. Bulls and Cows. Hash Table

补充内容 (2019-9-10 09:12):
734. Sentence Similarity. defaultdict(set), zip

补充内容 (2019-9-10 09:25):
747. Largest Number At Least Twice of Others. Largest and second largest
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-12 01:07:55 | 只看该作者
全局:
本帖最后由 clairefig 于 2019-9-12 01:49 编辑

162. Find Peak Element. Binary search on unsorted array for local maximum.

208. Implement Trie (Prefix Tree). Implement TrieNode first. Binary tree with more childrens. dict or array for children nodes

228. Summary Ranges. 貌似是可以binary search,流行AC解法都是线性解。

230. Kth Smallest Element in a BST. BST inorder traverse

247. Strobogrammatic Number II.

249. Group Shifted Strings. circular modula %


补充内容 (2019-9-12 02:09):
251. Flatten 2D Vector.

补充内容 (2019-9-12 02:26):
59. 3Sum Smaller. Two pointers on sorted array

补充内容 (2019-9-12 09:34):
979. Distribute Coins in Binary Tree. DFS on bt

补充内容 (2019-9-12 09:46):
951. Flip Equivalent Binary Trees. DFS on BT
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-13 02:07:20 | 只看该作者
全局:
1110. Delete Node and Return Forest. parameter downstream and return upstream

1087. Brace expansion.

1055. Shortest way to Form String

117. Populating Next Right Pointers in Each Node II


补充内容 (2019-9-13 03:25):
334. Increasing Triplet Subsequence. 跟longest increasing subsequence思路有点类似。

补充内容 (2019-9-13 09:10):
896. Monotonic Array.

补充内容 (2019-9-13 09:18):
1099. Two Sum Less Than K

补充内容 (2019-9-13 09:25):
997. Find the Town Judge

补充内容 (2019-9-13 09:58):
994. Rotting Oranges. BFS on Grid Graph

补充内容 (2019-9-13 10:45):
256. Paint House. Dynamic programming as Easy....
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-14 01:13:55 | 只看该作者
全局:
987. Vertical Order Traversal of a Binary Tree. 应该是BFS最优,可以省去Y的排序。虽然简单粗暴也可以AC。
回复

使用道具 举报

🔗
 楼主| clairefig 2019-9-14 23:07:23 | 只看该作者
全局:
222. Count Complete Tree Nodes. 在最后一行做Binary Search找插入点。每次evaluation by index的思路也是binary search类似
回复

使用道具 举报

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

本版积分规则

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