摘要:
题目:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it c... 阅读全文
摘要:
题目:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarificatio... 阅读全文
摘要:
题目:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra s... 阅读全文
摘要:
题目:Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit i... 阅读全文
摘要:
题目:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to ... 阅读全文
摘要:
题目:Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1... 阅读全文
摘要:
题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the... 阅读全文
摘要:
题目: 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 foll... 阅读全文
摘要:
题目:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[[ ... 阅读全文