摘要:
题目描述 Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: 解题思路: 在给定的序列[1,n]下,我们来构造二叉搜索树,首先对于序列中的每个数我们 阅读全文
摘要:
题目描述: In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in secon 阅读全文
摘要:
题目描述: Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever 阅读全文
摘要:
题目描述: Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input:s = "anagram", t = "nagaram" Output: true Ex 阅读全文
摘要:
一、题目描述 Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of 阅读全文
摘要:
一、题目描述 A full binary tree is a binary tree where each node has exactly 0 or 2 children. Return a list of all possible full binary trees with N nodes. 阅读全文
摘要:
一、题目描述 A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right a 阅读全文
摘要:
一、 题目描述: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment 阅读全文
摘要:
一、题目描述 对于一个有正有负的整数数组,请找出总和最大的连续数列。 给定一个int数组A和数组大小n,请返回最大的连续数列的和。保证n的大小小于等于3000。 测试样例: int getMaxSum(vector<int> A, int n) { // write code here //maxs 阅读全文
摘要:
一、题目描述: 大致意思是:判定棋盘的状态是否符合规则 A Tic-Tac-Toe board is given as a string array board. Return True if and only if it is possible to reach this board positi 阅读全文