上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 61 下一页
摘要: Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I 阅读全文
posted @ 2020-02-29 08:19 CNoodle 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bot 阅读全文
posted @ 2020-02-29 07:39 CNoodle 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image. Example: Input: 阅读全文
posted @ 2020-02-29 05:23 CNoodle 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Clarification: What shoul 阅读全文
posted @ 2020-02-29 03:13 CNoodle 阅读(517) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: MinStack() initializes 阅读全文
posted @ 2020-02-18 02:07 CNoodle 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(426) 评论(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 阅读(540) 评论(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 阅读(237) 评论(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 阅读(429) 评论(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 阅读(257) 评论(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 阅读(435) 评论(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 阅读(447) 评论(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 阅读(432) 评论(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 阅读(477) 评论(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 阅读(477) 评论(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 阅读(473) 评论(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 阅读(441) 评论(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 阅读(505) 评论(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 阅读(468) 评论(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 阅读(559) 评论(0) 推荐(0) 编辑
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 61 下一页