114Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.

angledark0123 發表在 痞客邦 留言(1) 人氣()

764Largest Plus Sign

In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. What is the largest axis-aligned plus sign of 1s contained in the grid? Return the order of the plus sign. If there is none, return 0.

angledark0123 發表在 痞客邦 留言(0) 人氣()

316Remove Duplicate Letters

Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.

angledark0123 發表在 痞客邦 留言(0) 人氣()

140. Word Break II

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. You may assume the dictionary does not contain duplicate words.

angledark0123 發表在 痞客邦 留言(0) 人氣()

題目落落長 https://codejam.withgoogle.com/codejam/contest/dashboard?c=8384486#s=p2

簡化來說就是要判斷如果是任意 字母排序,判斷某word 是否可以在中間

angledark0123 發表在 痞客邦 留言(0) 人氣()

785. Is Graph Bipartite?

Given a graph, return true if and only if it is bipartite.

angledark0123 發表在 痞客邦 留言(0) 人氣()

670Maximum Swap

Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get.

angledark0123 發表在 痞客邦 留言(0) 人氣()

269Alien Dictionary


angledark0123 發表在 痞客邦 留言(0) 人氣()

127Word Ladder

Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that:

angledark0123 發表在 痞客邦 留言(0) 人氣()

261Graph Valid Tree

Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree.

angledark0123 發表在 痞客邦 留言(0) 人氣()