随笔分类 -  LeetCode

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 61 下一页
摘要:A complete binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possibl 阅读全文
posted @ 2019-10-23 23:55 Grandyang 阅读(5184) 评论(4) 推荐(0)
摘要:Given a circular array C of integers represented by , find the maximum possible sum of a non empty subarray of C. Here, a circular array means the end 阅读全文
posted @ 2019-10-21 21:26 Grandyang 阅读(5354) 评论(2) 推荐(0)
摘要:Given a string , return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their positio 阅读全文
posted @ 2019-10-18 23:43 Grandyang 阅读(2330) 评论(0) 推荐(1)
摘要:In a 2D grid of s and s, we change at most one to a . After, what is the size of the largest island? (An island is a 4 directionally connected group o 阅读全文
posted @ 2019-10-13 23:32 Grandyang 阅读(3991) 评论(2) 推荐(0)
摘要:We are given two arrays and of words. Each word is a string of lowercase letters. Now, say that word is a subset of word if every letter in occurs in 阅读全文
posted @ 2019-10-04 23:33 Grandyang 阅读(2604) 评论(0) 推荐(0)
摘要:Let's define a function that returns the number of unique characters on , for example if then , ,`"C" "O" "D" s`, therefore . On this problem given a 阅读全文
posted @ 2019-10-01 23:36 Grandyang 阅读(3487) 评论(0) 推荐(0)
摘要:Given an array , partition it into two (contiguous) subarrays and so that: Every element in is less than or equal to every element in . and are non em 阅读全文
posted @ 2019-09-29 23:25 Grandyang 阅读(2131) 评论(0) 推荐(0)
摘要:Given a positive integer , how many ways can we write it as a sum of consecutive positive integers? Example 1: Example 2: Example 3: Note: `1 这道题给了一个正 阅读全文
posted @ 2019-09-26 23:54 Grandyang 阅读(4005) 评论(2) 推荐(0)
摘要:In a deck of cards, each card has an integer written on it. Return if and only if you can choose such that it is possible to split the entire deck int 阅读全文
posted @ 2019-09-23 23:20 Grandyang 阅读(2517) 评论(0) 推荐(0)
摘要:An undirected, connected tree with N nodes labelled 0...N-1 and N-1 edges are given. The ith edge connects nodes edges[i][0] and edges[i][1] together. 阅读全文
posted @ 2019-09-14 23:46 Grandyang 阅读(5252) 评论(1) 推荐(2)
摘要:A game on an undirected graph is played by two players, Mouse and Cat, who alternate turns. The graph is given as follows: is a list of all nodes such 阅读全文
posted @ 2019-09-12 23:55 Grandyang 阅读(4465) 评论(4) 推荐(0)
摘要:Two strings X and Y are similar if we can swap two letters (in different positions) of X, so that it equals Y. For example, "tars" and "rats" are simi 阅读全文
posted @ 2019-09-10 22:14 Grandyang 阅读(3310) 评论(5) 推荐(0)
摘要:Given an array of integers , sort the array in ascending order. Example 1: Example 2: Note: 1. `1 这道题让我们给数组排序,在平时刷其他题的时候,遇到要排序的时候,一般都会调用系统自带的排序函数,像 C+ 阅读全文
posted @ 2019-09-07 23:52 Grandyang 阅读(5329) 评论(1) 推荐(0)
摘要:This problem is an interactive problem new to the LeetCode platform. We are given a word list of unique words, each word is 6 letters long, and one wo 阅读全文
posted @ 2019-09-02 21:45 Grandyang 阅读(6591) 评论(0) 推荐(0)
摘要:In an election, the th vote was cast for at time . Now, we would like to implement the following query function: will return the number of the person 阅读全文
posted @ 2019-08-27 23:48 Grandyang 阅读(2235) 评论(0) 推荐(0)
摘要:An undirected, connected graph of N nodes (labeled 0, 1, 2, ..., N-1) is given as graph. graph.length = N, and j != i is in the list graph[i] exactly 阅读全文
posted @ 2019-08-25 23:37 Grandyang 阅读(4186) 评论(2) 推荐(1)
摘要:Given a rooted binary tree, return the lowest common ancestor of its deepest leaves. Recall that: The node of a binary tree is a leaf if and only if i 阅读全文
posted @ 2019-08-22 22:39 Grandyang 阅读(3102) 评论(0) 推荐(0)
摘要:We are given a list of (axis aligned) . Each , where (x1, y1) are the coordinates of the bottom left corner, and (x2, y2) are the coordinates of the t 阅读全文
posted @ 2019-08-18 02:56 Grandyang 阅读(4821) 评论(0) 推荐(3)
摘要:Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and add x to A[i] (only once). After this process, we ha 阅读全文
posted @ 2019-08-15 23:29 Grandyang 阅读(3256) 评论(2) 推荐(0)
摘要:Strings and are similar (for some non negative integer ) if we can swap the positions of two letters in exactly times so that the resulting string equ 阅读全文
posted @ 2019-08-13 02:37 Grandyang 阅读(3622) 评论(2) 推荐(0)

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 61 下一页
Fork me on GitHub