随笔分类 - LeetCode
摘要:问题描述:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's...
阅读全文
摘要:问题描述Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3]...
阅读全文
摘要:问题描述:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space ...
阅读全文
摘要:问题描述:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t...
阅读全文
摘要:问题描述Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space...
阅读全文
摘要:Clarification:What constitutes a word?A sequence of non-space characters constitutes a word.Could the input string contain leading or trailing spaces?...
阅读全文
摘要:Question:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close...
阅读全文