732. My Calendar III Implement a MyCalendarThree class to store your events. A new even...
732. My Calendar III Implement a MyCalendarThree class to store your events. A new even...
283. Move Zeros Given an array nums, write a function to move all 0's to the end of it ...
BFS找最短路径用level order,有模版。图上的搜素记得考虑用户visited数组 675. Cut Off Trees for Golf Event You are...
hashmap<count,index> map.containsKey()时更新最值不put,没有时put 根据后面找前面,不用初始化prefix数组或hashmap 56...
404. Sum of Left Leaves 3/ 9 20/ 15 7 There are two left leaves in the binary tree,...
二分Index 287. Find the Duplicate Number Given an array nums containing n + 1 integers wh...
Stack 735. Asteroid Collision We are given an array asteroids of integers representing ...
341. Flatten Nested List Iterator Stack的用法,list从后往前加入stack。如果涉及到移除元素的话 stack方便逻辑写在hasNe...
Hash 720. Longest Word in Dictionary Given a list of strings words representing an Engl...
538. Convert BST to Greater Tree Given a Binary Search Tree (BST), convert it to a Grea...
图上的DFS isVisited for(row){ for(column){ helper()}} 构建图 694. Number of Distinct Islands ...
3. Longest Substring Without Repeating Characters Given a string, find the length of th...
你是怎么想到的+复杂度 多重循环 定义DP数组,一般自顶向下,从起点到该位置的int,boolean 初始化DP数组 多重循环填充数组 568. Maximum Vacati...
286. Walls and Gates -1 - A wall or an obstacle.0 - A gate.INF - Infinity means an empt...
Heap: LRU Cache:用hashmap和双向linkedlist结合做缓存,hashmap使得查询时间是O(1),链表用来保存时间轴 Hash Function 如...
有一个全局最大最小值时,一个循环之后要判断是否需要更新这个全局变量免得写if else语句 Triangle的几种解法: traverse因为每条路都要走,n行的三角形就有就...
8.17在公司调网站,聚餐没作8.19在芝加哥机场延误时候写了几道简单的动归这几天刚到匹兹堡买东西太累,今天重新开始,明天ori开始 何时使用动归:1 求最值2 一个方向从一...
排序用priorityqueue有奇效,求第k个大的数,前K个大的数,mergeK个链表,用一个minheap 遍历HashMap: 巧妙 需要学习 !!!降序return ...
expression expand挺多点需要注意的,题很有意思,想递归觉得应该由简单到复杂去想,如何处理a,再一步步想,a -> 2[a] -> a[2[a]], 类型的转化...