337House Robber III

The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the police if two directly-linked houses were broken into on the same night.

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

23Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.

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

116Populating Next Right Pointers in Each Node

Given a binary tree

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

341Flatten Nested List Iterator

Given a nested list of integers, implement an iterator to flatten it.

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

 

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

621Task Scheduler

Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could be done without original order. Each task could be done in one interval. For each interval, CPU could finish one task or just be idle.

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

56Merge Intervals

Given a collection of intervals, merge all overlapping intervals.

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

761. Special Binary String

Special binary strings are binary strings with the following two properties:

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

139Word Break

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You may assume the dictionary does not contain duplicate words.

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

236Lowest Common Ancestor of a Binary Tree 

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.

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