上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 64 下一页
摘要: You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the 阅读全文
posted @ 2020-02-17 13:17 CNoodle 阅读(454) 评论(0) 推荐(0)
摘要: You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day  阅读全文
posted @ 2020-02-17 13:02 CNoodle 阅读(570) 评论(0) 推荐(0)
摘要: We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign r 阅读全文
posted @ 2020-02-16 13:55 CNoodle 阅读(257) 评论(0) 推荐(0)
摘要: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl 阅读全文
posted @ 2020-02-16 08:38 CNoodle 阅读(443) 评论(0) 推荐(0)
摘要: According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Hort 阅读全文
posted @ 2020-02-15 07:36 CNoodle 阅读(286) 评论(0) 推荐(0)
摘要: Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. You must do it in place. Example 1: Input: matrix = [[ 阅读全文
posted @ 2020-02-14 06:52 CNoodle 阅读(466) 评论(0) 推荐(0)
摘要: Given a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order. Example 1: Input: n = 3 Output: [[1,2,3],[8,9, 阅读全文
posted @ 2020-02-14 03:24 CNoodle 阅读(460) 评论(0) 推荐(0)
摘要: Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,2,3,6,9,8,7, 阅读全文
posted @ 2020-02-14 02:44 CNoodle 阅读(443) 评论(0) 推荐(0)
摘要: You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means 阅读全文
posted @ 2020-02-14 01:51 CNoodle 阅读(487) 评论(0) 推荐(0)
摘要: There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i]. You have a car with an unlimited gas tank and i 阅读全文
posted @ 2020-02-13 03:20 CNoodle 阅读(507) 评论(0) 推荐(0)
摘要: You are climbing a staircase. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cli 阅读全文
posted @ 2020-02-13 02:53 CNoodle 阅读(512) 评论(0) 推荐(0)
摘要: Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, convert it to the simpl 阅读全文
posted @ 2020-02-13 01:35 CNoodle 阅读(454) 评论(0) 推荐(0)
摘要: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the lef 阅读全文
posted @ 2020-02-12 03:12 CNoodle 阅读(531) 评论(0) 推荐(0)
摘要: Given the head of a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-b 阅读全文
posted @ 2020-02-11 03:08 CNoodle 阅读(482) 评论(0) 推荐(0)
摘要: Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree. A height-balanced bi 阅读全文
posted @ 2020-02-11 02:33 CNoodle 阅读(590) 评论(0) 推荐(0)
摘要: Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from left to right, level by level from leaf 阅读全文
posted @ 2020-02-11 01:05 CNoodle 阅读(431) 评论(0) 推荐(0)
摘要: Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n. Examp 阅读全文
posted @ 2020-02-10 13:28 CNoodle 阅读(485) 评论(0) 推荐(0)
摘要: Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. (i.e., from left to right, then right to left for the n 阅读全文
posted @ 2020-02-06 01:44 CNoodle 阅读(409) 评论(0) 推荐(0)
摘要: Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node co 阅读全文
posted @ 2020-01-31 03:03 CNoodle 阅读(483) 评论(0) 推荐(0)
摘要: Given the root node of a binary search tree and two integers low and high, return the sum of values of all nodes with a value in the inclusive range [ 阅读全文
posted @ 2020-01-30 03:19 CNoodle 阅读(214) 评论(0) 推荐(0)
上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 64 下一页