Tag Archives: DFS

  1. Number of Distinct Islands

    Leave a comment

    October 8, 2017 by oneOokay

    问题在于如何存/translate an island so you can distinct them from each other. 我的代码跑过了所有700+个test case但是就是最后两个跑不过,而且test case太大不可能debug.最终拿了别人的pass的代码一个一个比较output才明白为什么我卡在最后两个test case了… 我的: main method里面 boolean[][] visited和String …
    Continue reading

  2. Walls and Gates

    Leave a comment

    September 21, 2017 by oneOokay

    You are given a m x n 2D grid initialized with these three possible values. -1 – A wall or an obstacle. 0 – …
    Continue reading

  3. Combination Sum IV

    Leave a comment

    September 16, 2017 by oneOokay

    其他的Combination Sum Combination Sum IV Given an integer array with all positive numbers and no duplicates, find the number of …
    Continue reading

  4. 01 Matrix

    Leave a comment

    June 20, 2017 by oneOokay

    Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance …
    Continue reading

  5. Generate Parentheses

    Leave a comment

    May 14, 2017 by oneOokay

    Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = …
    Continue reading

  6. Longest Increasing Path in a Matrix

    Leave a comment

    December 19, 2016 by oneOokay

    Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to …
    Continue reading

  7. Course Schedule I II

    Leave a comment

    December 19, 2016 by oneOokay

    There are a total of n courses you have to take, labeled from 0 to n – 1. Some courses …
    Continue reading