摘要:
题目: Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for 阅读全文
摘要:
题目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its pa 阅读全文
摘要:
题目: Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty s 阅读全文
摘要:
题目: A robot is located at the top-left corner of a m x ngrid (marked 'Start' in the diagram below). The robot can only move either down or right at an 阅读全文
摘要:
题目: Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2 阅读全文
摘要:
题目: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,We get the following sequ 阅读全文
摘要:
题目: Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. For example,Given n = 3, You should return the fol 阅读全文
摘要:
题目: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last 阅读全文
摘要:
题目: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were in 阅读全文
摘要:
题目: Given a collection of intervals, merge all overlapping intervals. For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. Given 阅读全文
摘要:
题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your m 阅读全文
摘要:
题目: Given a matrix of m x n elements (m rows, ncolumns), return all elements of the matrix in spiral order. For example,Given the following matrix: Yo 阅读全文
摘要:
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,− 阅读全文
摘要:
题目: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. Show Tags Show Simila 阅读全文
摘要:
题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return 阅读全文
摘要:
题目: Implement pow(x, n). 链接: http://leetcode.com/problems/powx-n/ 题解: 使用二分法求实数幂,假如不建立临时变量halfPow,直接return计算结果的话会超时,还没仔细研究为什么。 Time Complexity - O(logn 阅读全文
摘要:
题目: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. Hide Tags Hash Table String Giv 阅读全文
摘要:
题目: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up:Could you do this in-place? 链接: http 阅读全文
摘要:
题目: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following uniqu 阅读全文
摘要:
题目: Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2 阅读全文