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

西雅图打卡

🔗
 楼主| deepforce 2019-10-14 13:56:29 | 只看该作者

10/13/2019

全局:
85. Maximal RectangleProblem: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
Solution: DP
思路是参照大神:https://leetcode.com/problems/ma ... hare-my-DP-solution


76. Minimum Window Substring
Problem: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
Solution: 经典Sliding window

回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-15 09:49:52 | 只看该作者

10/14/2019

全局:
794. Valid Tic-Tac-Toe StateProblem: Return True if and only if it is possible to reach this board position during the course of a valid tic-tac-toe game.
Solution: Ensure 2 things: 1. Number of 'x' equal to number of 'o' or bigger than 1.
                                     2. 1) if 'o' wins, # of 'x' = # of 'o'
                                         2) if 'x' wins, 1 or 2 line(s) with same symbol
                                         3) if no one wins, 0 line with same symbbol
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-15 11:28:58 | 只看该作者
全局:
301. Remove Invalid Parentheses
Problem: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.
Solution: Count the number of left and right parentheses that should be removed at first. Use DFS to find out all solutions.
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-15 11:43:53 | 只看该作者
全局:
211. Add and Search Word - Data structure design
Problem: Design a data structure that supports the following two operations: void addWord(word) & bool search(word)
Solution: Construct the Trie data structure. If find '.', use dfs to recur every character.
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-16 13:43:49 | 只看该作者

10/15/2019

全局:
791. Custom Sort StringProblem: Given S in a custom order, return any permutation of T (as a string) that satisfies the order in S.
Solution: Count the number of each character in T. First, add characters in S (which has order) to the result. Last, add characters without order.
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-17 07:42:31 | 只看该作者

10/16/2019

全局:
23. Merge k Sorted Lists
Problem: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
Solution: Priority queue O(NlogN)

124. Binary Tree Maximum Path Sum
Problem: Given a non-empty binary tree, find the maximum path sum.
Solution: Recursion. Compare substree (left, right) and root value, 2 situations.
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-17 09:06:36 | 只看该作者
全局:
71. Simplify PathProblem: Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path.
Solution: Stack
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-17 13:24:53 | 只看该作者
全局:
224. Basic CalculatorProblem: Implement a basic calculator to evaluate a simple expression string.
Solution: Stack
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-22 09:11:23 | 只看该作者
全局:
843. Guess the Word
Problem: Guess the word at most 10 times.
Solution: Minimax. 算法效率优化
回复

使用道具 举报

🔗
 楼主| deepforce 2019-10-22 12:21:33 | 只看该作者
全局:
809. Expressive Words
Problem: Given a list of query words, return the number of words that are stretchy.
Solution: two pointers
回复

使用道具 举报

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

本版积分规则

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