📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
楼主: 饺子没虾仁
跳转到指定楼层
上一主题 下一主题
收起左侧

2020个人战拖刷题打卡

🔗
 楼主| 饺子没虾仁 2020-3-27 06:30:37 | 只看该作者
全局:
03/26
55. Jump Game
Given an array of non-negative integers, starts at 0, each element in the array represents maximum jump length. Determine if you are able to reach the last index.
Solution: remember this method is to tell whether the method to jump out EXISTS! traverse the entire array and make sure there exists a certain point, arr[index] + index > arr.length
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-4 11:25:35 | 只看该作者
全局:
04/03
56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.
Solution: firstly sort the array(JS sort), then  make another empty nested array to push new array elements
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-7 08:53:51 | 只看该作者
全局:
04/04
62. Unique Paths
Calculated the steps from the top-left corner of a grid to the bottom-right
Solution: typical dynamic programming problem,

04/05
73. Set Matrix Zeroes
Solution: Easy peasy
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-8 07:42:41 | 只看该作者
全局:
04/07
75. Sort Colors
Given an array with only 0, 1, 2 three integers, sort them without using the built-in method
Solution: Brute Force, easy peasy,
Better solution: write a swap() method, that continuously pushes 0 to the front, and pushes 2 to the back
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-15 09:24:49 | 只看该作者
全局:
04/14
Review 412. FizzBuzz
Solution: easy peasy, try to solve it with a ternary operator

79. Word Search: Given a 2D board and a word, find if the word exists in the grid.
Solution: backtracking, recursion, the key is to mark the traversed text to avoid infinite loop
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-16 09:41:37 | 只看该作者
全局:
04/15
91. Decode Ways
Solution: dynamic programming, this problem is similar to Fibonacci series, except you need to check decode conditions (AB <= 26 ?)
The core of DP is to remember the calculated result during recursion
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-24 09:47:25 | 只看该作者
全局:
补上 04/18 | 94. Binary Tree Inorder Traversal
Solution: Recursive. Understand the three ways to traverse the binary tree: Inorder, Preorder and Postorder

04/23 Review 1. 2 Sum
Solved with Brute Force
Better Solution: Hash Table
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-4-29 05:26:34 | 只看该作者
全局:
04/28
98. Validate Binary Search Tree
Solution: recursion,  the key is to validate the root correctly in the recursion

Review
7. Reverse Integer

Easy Peasy, but what's the maximum and minimum signed integer value in JavaScript?
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-5-14 10:09:05 | 只看该作者
全局:
05/13
103. Binary Tree Zigzag Level Order Traversal

Easy Peasy, similar to the solution of 98
回复

使用道具 举报

🔗
 楼主| 饺子没虾仁 2020-6-18 08:00:28 | 只看该作者
全局:
最近有参加Leetcode的Leetcoding Challenge,集中贴一下
06/05 Random pick with weight
06/06 Queue Construction by Height
06/07 Coin Challenge 2
06/09 Is subsequence
06/12 Insert Delete GetRandom O(1)
06/17 Surrounded Regions

回复

使用道具 举报

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

本版积分规则

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