240 发简信
IP属地:宾夕法尼亚州
  • Interval

    732. My Calendar III Implement a MyCalendarThree class to store your events. A new even...

  • Two Pointers

    283. Move Zeros Given an array nums, write a function to move all 0's to the end of it ...

  • BFS

    BFS找最短路径用level order,有模版。图上的搜素记得考虑用户visited数组 675. Cut Off Trees for Golf Event You are...

  • Prefix Sum + HashMap

    hashmap<count,index> map.containsKey()时更新最值不put,没有时put 根据后面找前面,不用初始化prefix数组或hashmap 56...

  • Divide and Conquer

    404. Sum of Left Leaves 3/ 9 20/ 15 7 There are two left leaves in the binary tree,...

  • Binary Search

    二分Index 287. Find the Duplicate Number Given an array nums containing n + 1 integers wh...

  • Data Structure (Stack+Heap+TreeMap+Deque)

    Stack 735. Asteroid Collision We are given an array asteroids of integers representing ...

  • Design

    341. Flatten Nested List Iterator Stack的用法,list从后往前加入stack。如果涉及到移除元素的话 stack方便逻辑写在hasNe...

  • Hash

    Hash 720. Longest Word in Dictionary Given a list of strings words representing an Engl...

  • Tree

    538. Convert BST to Greater Tree Given a Binary Search Tree (BST), convert it to a Grea...

  • DFS

    图上的DFS isVisited for(row){ for(column){ helper()}} 构建图 694. Number of Distinct Islands ...

  • Sliding Window

    3. Longest Substring Without Repeating Characters Given a string, find the length of th...

  • DP

    你是怎么想到的+复杂度 多重循环 定义DP数组,一般自顶向下,从起点到该位置的int,boolean 初始化DP数组 多重循环填充数组 568. Maximum Vacati...

  • 2017-12-26

    286. Walls and Gates -1 - A wall or an obstacle.0 - A gate.INF - Infinity means an empt...

  • 8.12

    Heap: LRU Cache:用hashmap和双向linkedlist结合做缓存,hashmap使得查询时间是O(1),链表用来保存时间轴 Hash Function 如...

  • 8.15

    有一个全局最大最小值时,一个循环之后要判断是否需要更新这个全局变量免得写if else语句 Triangle的几种解法: traverse因为每条路都要走,n行的三角形就有就...

  • 8.22

    8.17在公司调网站,聚餐没作8.19在芝加哥机场延误时候写了几道简单的动归这几天刚到匹兹堡买东西太累,今天重新开始,明天ori开始 何时使用动归:1 求最值2 一个方向从一...

  • 8.13

    排序用priorityqueue有奇效,求第k个大的数,前K个大的数,mergeK个链表,用一个minheap 遍历HashMap: 巧妙 需要学习 !!!降序return ...

  • 8.11

    expression expand挺多点需要注意的,题很有意思,想递归觉得应该由简单到复杂去想,如何处理a,再一步步想,a -> 2[a] -> a[2[a]], 类型的转化...