随笔分类 - Great Questions
摘要:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. Example 2 1->2->3 => / \ 1 3 分析:非常简单,用递归
阅读全文
摘要:Remove Duplicates from Sorted List I Given a sorted linked list, delete all duplicates such that each element appear only once. Remove Duplicates from
阅读全文
摘要:560. Subarray Sum Equals K Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to
阅读全文
摘要:Flatten a binary tree to a fake "linked list" in pre-order traversal. Here we use the right pointer in TreeNode as the next pointer in ListNode. For e
阅读全文
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist
阅读全文
摘要:Given an integer array, adjust each integers so that the difference of every adjacent integers are not greater than a given number target. If the arra
阅读全文
摘要:Word Search I Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell
阅读全文
摘要:Question: Find the longest sub-string without repeating characters. For example, if the given string is "abcdcefg", the longest sub-string is "dcefg".
阅读全文
摘要:Word Break I Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionar
阅读全文
摘要:Question: Give a string, use minimum number of splits to divide the string into multiple parts in which each part a palindrome. For example, if the st
阅读全文
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan
阅读全文
摘要:Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume that there will be
阅读全文
摘要:Subsets I Given a set of distinct integers, return all possible subsets. Notice Elements in a subset must be in non-descending order. The solution set
阅读全文

浙公网安备 33010602011771号