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

[其他] 刷题刷的好心累

 
🔗
 楼主| 这里是我马甲呀 2022-1-10 00:36:31 来自APP | 只看该作者
全局:
kanmianjing899 发表于 2022-01-09 01:55:18
我现在跟你的感觉差不多,有的题能看出是啥tag但是写还是写不出。
楼主500题已经刷了4遍啦 hot tag基本都是6-9遍而且已经上岸啦~虽然没怎么见过的新题依然不是很会,经常写错,但是见过的一定能做对,并且followup也能答,所以只面了考原题那些公司,结果也还不错
回复

使用道具 举报

全局:
这里是我马甲呀 发表于 2022-01-09 08:36:31
楼主500题已经刷了4遍啦 hot tag基本都是6-9遍而且已经上岸啦~虽然没怎么见过的新题依然不是很会,经常写错,但是见过的一定能做对,并且followup也能答,所以只面了考原题那些公司,结果也
谢谢,还想问下你是什么签证上的岸?f1还是h4还是绿卡?我是个小f1。
回复

使用道具 举报

🔗
 楼主| 这里是我马甲呀 2022-1-10 08:23:02 来自APP | 只看该作者
全局:
kanmianjing899 发表于 2022-01-09 15:16:53
谢谢,还想问下你是什么签证上的岸?f1还是h4还是绿卡?我是个小f1。
这个帖子发的时候是f1 opt,两个月不到就上岸啦不过公司特别小基本没人认识那种,抽到h1b就跳到了fb现在,从小公司到fb期间都一直在刷(背题)
回复

使用道具 举报

全局:
这里是我马甲呀 发表于 2022-01-09 16:23:02
这个帖子发的时候是f1 opt,两个月不到就上岸啦不过公司特别小基本没人认识那种,抽到h1b就跳到了fb现在,从小公司到fb期间都一直在刷(背题)
听你说了我又有些信心了哈哈。最后问一下你全职前有实习过么?
回复

使用道具 举报

🔗
 楼主| 这里是我马甲呀 2022-1-10 08:30:22 来自APP | 只看该作者
全局:
kanmianjing899 发表于 2022-01-09 16:25:28
听你说了我又有些信心了哈哈。最后问一下你全职前有实习过么?
说实话,就我这刷题水平上岸大概率也是靠去年好市场和攒的人品加comminication还算好捞来的好运气,除了那小厂几道题我都是刷过的原题,其他的面试一个也没过因为题真的不会,就面试官都快告诉我答案了我都写不上,我是转码的之前有实习但是跟cs没什么关系叻
回复

使用道具 举报

🔗
freakpao 2022-2-17 05:14:13 | 只看该作者
全局:
“用行动上的勤奋来掩饰战术上的懒惰”。。。 戳中我了,膝盖疼
回复

使用道具 举报

全局:
重點要搞懂題目, 海刷戰術不見得適合所有人
回复

使用道具 举报

🔗
kenpeter 2022-10-13 20:18:08 | 只看该作者
全局:
本帖最后由 kenpeter 于 2022-10-13 23:19 编辑

1. 你对刷题是不是有误解?
2. 我建议你看看这个: https://www.zhihu.com/question/24051063
3. 大部份人是慢思维,至少我是
4. 你应该用几天的时间刷一道题
5. 你有没有想过为什么他们叫你一道题刷几十遍?就是记不住才刷几十遍。就是说刷一次的功效极低, 才要重复。
6. 你再看看这个。每一行代码都ask why. 问得越深越好。你一次就记住了. 你为什么看答案的时候要ask why, 因为你自己写的时候就像dfs, 会有n步骤, 你会开始confuse, swing, 也不知道写什么,为什么要写?
7. so you have to deep thinking for each line of code

e.g. https://leetcode.com/problems/minesweeper/
  1. /**
  2. * @param {character[][]} board
  3. * @param {number[]} click
  4. * @return {character[][]}
  5. */

  6. var dfs = function(d, b, click) {
  7.     // * why the cell in board is the underneath actual value? <----
  8.     // * because if we know the actual value, we can display the value in the board for user
  9.    
  10.     // * why click has row and col? <---
  11.     // * because it is the start position in the grid
  12.     const r = click[0];
  13.     const c = click[1];
  14.     // * this is row, go down
  15.     const m = b.length;
  16.     // * this is col, go right
  17.     const n = b[0].length;
  18.    
  19.     let mNum = 0;
  20.     // * why the dfs queue arr is empty at each dfs level? <---
  21.     // * because next dfs level, the click will have its own dfs queue
  22.     // * because 8 directions, cause it own queue, in own dfs level
  23.     const empty = [];
  24.    
  25.     // * why do we hit the directions straight away, there is no loop to travel? <---
  26.     // * yes, because there is no loop here, so only direction
  27.    
  28.     // * if we click a cell, the direction is like a sum with diff direciton of shine, why? <---
  29.     // * because the middle is the central cell, then 8 directions are the shines
  30.    
  31.     // * why we loop the 8 directions? <---
  32.     // * because click 1 spot, we will hit all 8 directions
  33.     // * it can be 4 directions or an upgrade: 8 directions
  34.     for(let [r1, c1] of d) {
  35.         // * why we need row = curr_row + row_d, col = curr_col + col_d? <---
  36.         // * because after loop each direction, we have a new move
  37.         // * we can check boundary with this new move
  38.         const r2 = r + r1;
  39.         const c2 = c + c1;
  40.         
  41.         // * so this is to check the future boundary
  42.         if(r2 < 0 || c2 < 0 || r2 >= m || c2 >= n) continue;
  43.         
  44.         // * why we only check boundary, we don't have other condi to check? <--
  45.         // * because after boundary check pass, we will hit mine (M, acc), E (empty, queue), B (blank, seen),
  46.         // * D (digit, seen), X (reveal, never)
  47.         // * why we don't need seen here? <---
  48.         // * because there is no cycle;
  49.         // * seen good for cycle
  50.         
  51.         // * why we need to care mine (M = mine)? <---
  52.         // * because if we acc all 8 directions, we know the total mine number, so we can assign to start point????????
  53.         // * why we need to care empty square (E = empty)? <---
  54.         // * because if we see empty (E), then we can push to arr, then loop this arr -> dfs
  55.         // * this allow new start point for dfs
  56.         // * why we don't care revealved square (B = blank)? <--
  57.         // * because already know before
  58.         // * not contribute to acc mine or dfs queue
  59.         // * why we don't care digit? (D = digit)? <--
  60.         // * because already know before
  61.         // * not contribute to acc mine or dfs queue
  62.         // * why we don't care revealed mine (X = explode)? <--
  63.         // * I don't think we will see this, if we see explode, then it is game over
  64.         // * the game still going so no care revealed.
  65.         
  66.         if(b[r2][c2] === 'M') {
  67.             // * why acc mine num? <---
  68.             // * because we need to asssgin to start point
  69.             // * why we see a future mine here, we stop, we do not do dfs? <----
  70.             // * because if we see a mine, it means this path cannot go further, so need to stop dfs path!!!!!!!!!
  71.             ++mNum;   
  72.         } else if(b[r2][c2] === 'E') {
  73.             // * if we can see empty, this means dfs path can continue, can keep going <---
  74.             // * so why put start point to arr? <---
  75.             // * because those dfs path can go down
  76.             empty.push([r2, c2]);
  77.         }
  78.     } // el
  79.    
  80.     // * if we see mine, we need to stop directly, even we have some dfs queue?
  81.     // * because ...?
  82.     if(mNum > 0) {
  83.         b[r][c] = String(mNum);
  84.     } else {
  85.         // * so why we revreal the click? <---
  86.         // * because in this dfs level, this click is used, so reveal it
  87.         // * the dfs queue is below, is acting like that it will simulate the click further (further reveal)
  88.         b[r][c] = 'B';
  89.         
  90.         // * why the element in queue order is the dir order? <----
  91.         // * because we loop direction, then add to dfs queue, so dfs queue order === direction order
  92.         for(let [x, y] of empty) {
  93.             dfs(d, b, [x, y]);
  94.         }
  95.     }
  96. }

  97. var updateBoard = function(b, click) {
  98.     // * why do we need the 8 cell grid direction? <---
  99.     // * because click 1 spot, then all 8 directions get exploded.
  100.     const d = [[-1, 0], [-1, 1], [0, 1], [1, 1], [1, 0], [1, -1], [0, -1], [-1, -1]];
  101.     // * why click has row?
  102.     // * because it will land on grid
  103.     const r = click[0];
  104.     // * why click has col?
  105.     // * because it will land on the grid
  106.     const c = click[1];
  107.    
  108.     // * why there is no loop then dfs? <---
  109.     // * because we have a click (start_row, start_col), then we just dfs init, goes down
  110.    
  111.     // * why we need to handle click the mine directly? <---
  112.     // * because if we don't handle here now, when goes into dfs, we only look at future 8 directions.
  113.     // * the curr one will be ignored, so we need to handle now.
  114.     // * why M === untouched mine? <----
  115.     // * because M is the init letter of Mine; it is a good and untouched mine.
  116.     // * why X === revealed mine? <----
  117.     // * because X looks like exploding and cross means bad
  118.     if(b[r][c] === 'M') {
  119.         b[r][c] = 'X';
  120.         // * why we need to return the board? <---
  121.         // * because we click on the mine, then explode, need to return board
  122.         return b;
  123.     } else {
  124.         // * why pass direction, beacuse new_row = row + row_d? <---
  125.         // * new_col = col + col_d
  126.         // * so we need the next move
  127.         dfs(d, b, click);
  128.         return b;
  129.     }
  130. };
复制代码
回复

使用道具 举报

🔗
qweasdzxc2019 2022-11-5 09:20:26 | 只看该作者
全局:
这里是我马甲呀 发表于 2022-1-9 17:30
说实话,就我这刷题水平上岸大概率也是靠去年好市场和攒的人品加comminication还算好捞来的好运气,除了那 ...

那你在fb做的怎么样啊。
回复

使用道具 举报

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

本版积分规则

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