摘要:
https://leetcode.com/problems/count-numbers-with-unique-digits/#/description 阅读全文
摘要:
https://leetcode.com/problems/shuffle-an-array/#/description 阅读全文
摘要:
https://leetcode.com/problems/add-two-numbers-ii/#/description 补充一个python的实现: 阅读全文
摘要:
https://leetcode.com/problems/diagonal-traverse/#/description 阅读全文
摘要:
https://leetcode.com/problems/total-hamming-distance/#/description 阅读全文
摘要:
https://leetcode.com/problems/linked-list-random-node/#/description 阅读全文
摘要:
https://leetcode.com/problems/next-greater-element-ii/#/solutions 关键的思路是将数组延长到2倍的长度,然后用%运算,将索引缩小到1倍之内进行1倍长度内的判断。 阅读全文
摘要:
https://leetcode.com/problems/minesweeper/#/description 提供一种会超时的解决方案: 按照BFS的思路来写,但是判断比较麻烦。 阅读全文
摘要:
这是第一种方法,主要是使用dfs来实现。 下面是第二种方法,是同学用python写的,我翻译成了C#,这种思路是union find。 从耗时角度来看,第一种效率略高一些。 https://leetcode.com/problems/friend-circles/#/description 阅读全文
摘要:
https://leetcode.com/problems/top-k-frequent-elements/#/description 补充一个python的实现,使用封装好的类库,代码很简洁。 阅读全文