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

NG转码小白刷题打卡

🔗
blabla333 2022-6-11 01:44:11 | 只看该作者
全局:
我也是刚刚开始刷题,想请教一下大家,我在写001 twoSum 的时候,我把array变成object, 然后查差额(remainder)的那个数字是否在object里面出现过, 我用if(object【remainder】) 形势查,也就是如果此value存在,那就说明他出现在object当中,可这样写不对,但如果我换成if(object[remainder]!=null) 就可以,请问这两者有什么区别?
0基础转码bootcamp选手,请教大家了!
谢谢!
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-11 07:38:35 来自APP | 只看该作者
全局:
blabla333 发表于 2022-06-10 10:44:11
我也是刚刚开始刷题,想请教一下大家,我在写001 twoSum 的时候,我把array变成object, 然后查差额(remainder)的那个数字是否在object里面出现过, 我用if(objec
你这个跟语言有关,我只熟python但你这明显不是Python,爱莫能助。可能跟Null能否当做bool量有关吧
回复

使用道具 举报

全局:
lkz4618 发表于 2022-06-10 16:38:35
你这个跟语言有关,我只熟python但你这明显不是Python,爱莫能助。可能跟Null能否当做bool量有关吧
谢谢!我用的是js
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-11 14:53:57 | 只看该作者
全局:
今天都是Medium,中间本来想找点easy放松放松,结果发现leetcode easy的比例只有大概1/4...medium题超过一半。那还是尝试习惯medium吧…… 唉hard都还没还是刷呢……
06/10 Fri: (total 120)
- weekly challenge:
- 1197. Minimum Knight Moves (Medium) https://leetcode.com/problems/minimum-knight-moves/
- blind 75:
- 150. Evaluate Reverse Polish Notation (Medium) https://leetcode.com/problems/evaluate-reverse-polish-notation/
- 1151. Minimum Swaps to Group All 1's Together (Medium) https://leetcode.com/problems/mi ... up-all-1s-together/
- Dynamic Programming I:
- 918. Maximum Sum Circular Subarray (Medium) https://leetcode.com/problems/ma ... -subarray/solution/
- Graph:
- 200. Number of Islands (Meidum) https://leetcode.com/problems/number-of-islands/
- 684. Redundant Connection (Medium) (union find) https://leetcode.com/problems/redundant-connection/
- 1254. Number of Closed Islands (Medium) https://leetcode.com/problems/number-of-closed-islands/
- 1658. Minimum Operations to Reduce X to Zero (Medium) https://leetcode.com/problems/mi ... o-reduce-x-to-zero/
- 325. Maximum Size Subarray Sum Equals k (Medium) https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-12 13:39:40 | 只看该作者
全局:
6/11 Sat: (total 126) 今天放松休息了,明天也有事估计做不了多少。不过开心的是周赛名次第一次进入三位数了…可惜第四题做出了第三题反而没做完,而且只差一点,下次再战吧。
- 1695. Maximum Erasure Value (Medium) daily challenge: https://leetcode.com/problems/maximum-erasure-value/
- blind75:
- 207. Course Schedule (Medium) (Topological Sort) https://leetcode.com/problems/course-schedule/
- Weekly Contest:
- 2303. Calculate Amount Paid in Taxes https://leetcode.com/problems/calculate-amount-paid-in-taxes/
- 2304. Minimum Path Cost in a Grid (Medium) https://leetcode.com/problems/minimum-path-cost-in-a-grid/
- 2305. Fair Distribution of Cookies (Medium) https://leetcode.com/problems/fair-distribution-of-cookies/
- 2306. Naming a Company (Hard) https://leetcode.com/problems/naming-a-company/
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-13 14:32:05 | 只看该作者
全局:
6/12 Sun: (total 132) 偷懒的一天,用easy题充数也才6道。但今天白天都出门有事,情有可原了。
- Algorithm II:
- 34. Find First and Last Position of Element in Sorted Array (Medium) https://leetcode.com/problems/fi ... nt-in-sorted-array/
- 162. Find Peak Element (Medium) https://leetcode.com/problems/find-peak-element/
- 9. Palindrome Number https://leetcode.com/problems/palindrome-number/
- 13. Roman to Integer https://leetcode.com/problems/roman-to-integer/
- 12. Integer to Roman (Medium) https://leetcode.com/problems/integer-to-roman/
- 14. Longest Common Prefix https://leetcode.com/problems/longest-common-prefix/
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-14 15:03:57 | 只看该作者
全局:
6/13 Mon: (total new 139) 计时做题很有效
- Graph Theory I:
- 1020. Number of Enclaves (Medium) https://leetcode.com/problems/nu ... erBy=hot&query=
- 1905. Count Sub Islands (Medium) https://leetcode.com/problems/count-sub-islands/
- 1162. As Far from Land as Possible (Medium) https://leetcode.com/problems/as-far-from-land-as-possible/
- 417. Pacific Atlantic Water Flow (Medium) https://leetcode.com/problems/pacific-atlantic-water-flow/
- 75. Sort Colors (Medium) https://leetcode.com/problems/sort-colors/
- 56. Merge Intervals (Medium) (note keep aware of list copy time cost) https://leetcode.com/problems/merge-intervals/
- 583. Delete Operation for Two Strings (Medium) https://leetcode.com/problems/delete-operation-for-two-strings/
- Review old questions:
- 45. Jump Game II (Medium) (gready instead of dp) https://leetcode.com/problems/jump-game-ii/
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-15 15:36:39 | 只看该作者
全局:
6/14 Tue: (total new 143) 忙research没时间刷
- 706. Design HashMap https://leetcode.com/problems/design-hashmap/
- 1048. Longest String Chain (Medium) https://leetcode.com/problems/longest-string-chain/
- 119. Pascal's Triangle II https://leetcode.com/problems/pascals-triangle-ii/
- 48. Rotate Image (Medium) https://leetcode.com/problems/rotate-image/
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-16 15:42:08 | 只看该作者
全局:
6/14 Tue: (total new 148) 进入瓶颈了,做>=medium一天只能5道,不过今天学了Trie,还行吧
- 5. Longest Palindromic Substring (Medium) https://leetcode.com/problems/longest-palindromic-substring/
- Data Structure II:
- 59. Spiral Matrix II (Medium) https://leetcode.com/problems/spiral-matrix-ii/
- 240. Search a 2D Matrix II (Medium) 没写全所有方法 https://leetcode.com/problems/search-a-2d-matrix-ii/
- 435. Non-overlapping Intervals (Medium) https://leetcode.com/problems/non-overlapping-intervals/
- 527. Word Abbreviation (Hard) (Trie as an option) https://leetcode.com/problems/word-abbreviation/

补充内容 (2022-06-17 15:55 +8:00):
应该是6/15 Wed
回复

使用道具 举报

🔗
 楼主| lkz4618 2022-6-17 15:56:47 | 只看该作者
全局:
6/16 Thu: (total new 159) 今天战果不错,但也没学啥新东西。以后目标就是每天至少5道Mdeiun+吧,睡前补点easy题build confidence哈哈
- 968. Binary Tree Cameras (Hard) https://leetcode.com/problems/binary-tree-cameras/
- Algorithm II:
- 82. Remove Duplicates from Sorted List II (Medium) https://leetcode.com/problems/re ... rom-sorted-list-ii/
- 844. Backspace String Compare https://leetcode.com/problems/backspace-string-compare/
- 986. Interval List Intersections (Medium) https://leetcode.com/problems/interval-list-intersections/
- 438. Find All Anagrams in a String (Medium) https://leetcode.com/problems/find-all-anagrams-in-a-string/
- 713. Subarray Product Less Than K (Medium) https://leetcode.com/problems/subarray-product-less-than-k/
- 209. Minimum Size Subarray Sum (Medium) https://leetcode.com/problems/minimum-size-subarray-sum/
- Having fun with easy questions~:
- 26. Remove Duplicates from Sorted Array https://leetcode.com/problems/re ... -from-sorted-array/
- 27. Remove Element https://leetcode.com/problems/remove-element/
- 28. Implement strStr() https://leetcode.com/problems/implement-strstr/
- 58. Length of Last Word https://leetcode.com/problems/length-of-last-word/
回复

使用道具 举报

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

本版积分规则

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