- 博客(120)
- 资源 (13)
- 问答 (1)
- 收藏
- 关注
原创 [leetcode] 1328. Break a Palindrome
DescriptionGiven a palindromic string palindrome, replace exactly one character by any lowercase English letter so that the string becomes the lexicographically smallest possible string that isn’t a palindrome.After doing so, return the final string. If
2020-10-31 19:19:23 230
原创 [leetcode] 1138. Alphabet Board Path
DescriptionOn an alphabet board, we start at position (0, 0), corresponding to character board[0][0].Here, board = [“abcde”, “fghij”, “klmno”, “pqrst”, “uvwxy”, “z”], as shown in the diagram below.We may make the following moves:‘U’ moves our positio
2020-10-31 17:58:38 200
原创 [leetcode] 1108. Defanging an IP Address
DescriptionGiven a valid (IPv4) IP address, return a defanged version of that IP address.A defanged IP address replaces every period “.” with “[.]”.Example 1:Input: address = "1.1.1.1"Output: "1[.]1[.]1[.]1"Example 2:Input: address = "255.100.50.0"
2020-10-31 16:43:20 106
原创 [leetcode] 1081. Smallest Subsequence of Distinct Characters
DescriptionReturn the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once.Note: This question is the same as 316: https://leetcode.com/problems/remove-duplicate-letters/Example 1:Input: s = "bcabc"Ou
2020-10-31 16:37:42 182
原创 [leetcode] 1071. Greatest Common Divisor of Strings
DescriptionFor two strings s and t, we say “t divides s” if and only if s = t + … + t (t concatenated with itself 1 or more times)Given two strings str1 and str2, return the largest string x such that x divides both str1 and str2.Example 1:Input: str1
2020-10-31 16:01:09 154
原创 [leetcode] 1023. Camelcase Matching
DescriptionA query word matches a given pattern if we can insert lowercase letters to the pattern word so that it equals the query. (We may insert each character at any position, and may insert 0 characters.)Given a list of queries, and a pattern, return
2020-10-31 15:26:26 192
原创 [leetcode] 1016. Binary String With Substrings Representing 1 To N
DescriptionGiven a binary string S (a string consisting only of ‘0’ and '1’s) and a positive integer N, return true if and only if for every integer X from 1 to N, the binary representation of X is a substring of S.Example 1:Input: S = "0110", N = 3Out
2020-10-31 12:56:23 170
原创 [leetcode] 1003. Check If Word Is Valid After Substitutions
DescriptionGiven a string s, determine if it is valid.A string s is valid if, starting with an empty string t = “”, you can transform t into s after performing the following operation any number of times:Insert string “abc” into any position in t. More
2020-10-31 12:00:05 130
原创 [leetcode] 966. Vowel Spellchecker
DescriptionGiven a wordlist, we want to implement a spellchecker that converts a query word into a correct word.For a given query word, the spell checker handles two categories of spelling mistakes:Capitalization: If the query matches a word in the wo
2020-10-31 11:20:54 164
原创 [leetcode] 937. Reorder Data in Log Files
DescriptionYou have an array of logs. Each log is a space delimited string of words.For each log, the first word in each log is an alphanumeric identifier. Then, either:Each word after the identifier will consist only of lowercase letters, or;Each w
2020-10-31 00:34:10 112
原创 [leetcode] 929. Unique Email Addresses
DescriptionEvery email consists of a local name and a domain name, separated by the @ sign.For example, in alice@leetcode.com, alice is the local name, and leetcode.com is the domain name.Besides lowercase letters, these emails may contain '.'s or '+'s.
2020-10-30 23:47:55 180
原创 [leetcode] 925. Long Pressed Name
DescriptionYour friend is typing his name into a keyboard. Sometimes, when typing a character c, the key might get long pressed, and the character will be typed 1 or more times.You examine the typed characters of the keyboard. Return True if it is poss
2020-10-30 23:01:29 179
原创 [leetcode] 917. Reverse Only Letters
DescriptionGiven a string S, return the “reversed” string where all characters that are not a letter stay in the same place, and all letters reverse their positions.Example 1:Input: "ab-cd"Output: "dc-ba"Example 2:Input: "a-bC-dEf-ghIj"Output: "j-I
2020-10-30 22:35:43 185
原创 [leetcode] 916. Word Subsets
DescriptionWe are given two arrays A and B of words. Each word is a string of lowercase letters.Now, say that word b is a subset of word a if every letter in b occurs in a, including multiplicity. For example, “wrr” is a subset of “warrior”, but is not
2020-10-30 20:28:58 139
原创 [leetcode] 893. Groups of Special-Equivalent Strings
DescriptionYou are given an array A of strings.A move onto S consists of swapping any two even indexed characters of S, or any two odd indexed characters of S.Two strings S and T are special-equivalent if after any number of moves onto S, S == T.For ex
2020-10-30 19:52:47 158
原创 [leetcode] 890. Find and Replace Pattern
DescriptionYou have a list of words and a pattern, and you want to know which words in words matches the pattern.A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get
2020-10-29 23:50:49 241
原创 [leetcode] 1592. Rearrange Spaces Between Words
DescriptionYou are given a string text of words that are placed among some number of spaces. Each word consists of one or more lowercase English letters and are separated by at least one space. It’s guaranteed that text contains at least one word.Rearran
2020-10-29 23:32:05 294
原创 [leetcode] 1614. Maximum Nesting Depth of the Parentheses
DescriptionA string is a valid parentheses string (denoted VPS) if it meets one of the following:It is an empty string “”, or a single character not equal to “(” or “)”,It can be written as AB (A concatenated with B), where A and B are VPS’s, orIt can
2020-10-29 20:45:26 327
原创 [leetcode] 1616. Split Two Strings to Make Palindrome
DescriptionYou are given two strings a and b of the same length. Choose an index and split both strings at the same index, splitting a into two strings: aprefix and asuffix where a = aprefix + asuffix, and splitting b into two strings: bprefix and bsuffix
2020-10-29 20:37:47 186
原创 [leetcode] 1624. Largest Substring Between Two Equal Characters
DescriptionGiven a string s, return the length of the longest substring between two equal characters, excluding the two characters. If there is no such substring return -1.A substring is a contiguous sequence of characters within a string.Example 1:Inp
2020-10-29 00:24:09 255
原创 [leetcode] 709. To Lower Case
DescriptionImplement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1:Input: "Hello"Output: "hello"Example 2:Input: "here"Output: "here"Example 3:Input: "LOVELY"Output: "lovely"分析题目的意
2020-10-29 00:08:50 103
原创 [leetcode] 429. N-ary Tree Level Order Traversal
DescriptionGiven an n-ary tree, return the level order traversal of its nodes’ values.Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See examples).Example 1:Input: roo
2020-10-28 23:33:08 154
原创 [leetcode] 1609. Even Odd Tree
DescriptionA binary tree is named Even-Odd if it meets the following conditions:The root of the binary tree is at level index 0, its children are at level index 1, their children are at level index 2, etc.For every even-indexed level, all nodes at the
2020-10-28 23:26:41 186
原创 [leetcode] 1600. Throne Inheritance
DescriptionA kingdom consists of a king, his children, his grandchildren, and so on. Every once in a while, someone in the family dies or a child is born.The kingdom has a well-defined order of inheritance that consists of the king as the first member. L
2020-10-28 22:44:08 184
原创 [leetcode] 1530. Number of Good Leaf Nodes Pairs
DescriptionGiven the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shortest path between them is less than or equal to distance.Return the number of good leaf no
2020-10-28 20:23:47 269
原创 [leetcode] 1466. Reorder Routes to Make All Paths Lead to the City Zero
DescriptionThere are n cities numbered from 0 to n-1 and n-1 roads such that there is only one way to travel between two different cities (this network form a tree). Last year, The ministry of transport decided to orient the roads in one direction because
2020-10-28 19:52:48 256 1
原创 [leetcode] 1457. Pseudo-Palindromic Paths in a Binary Tree
DescriptionGiven a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the path is a palindrome.Return the number of pseudo-palindromic paths g
2020-10-28 13:01:35 242
原创 [leetcode] 1443. Minimum Time to Collect All Apples in a Tree
DescriptionGiven an undirected tree consisting of n vertices numbered from 0 to n-1, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend in order to collect al
2020-10-28 00:14:22 206
原创 [leetcode] 1448. Count Good Nodes in Binary Tree
DescriptionGiven a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.Return the number of good nodes in the binary tree.Example 1:Input: root = [3,1,4,3,null,1,5]Output: 4
2020-10-27 21:27:57 277
原创 [leetcode] 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
DescriptionGiven two binary trees original and cloned and given a reference to a node target in the original tree.The cloned tree is a copy of the original tree.Return a reference to the same node in the cloned tree.Note that you are not allowed to cha
2020-10-27 20:39:28 207
原创 [leetcode] 1367. Linked List in Binary Tree
DescriptionGiven a binary tree root and a linked list with head as the first node.Return True if all the elements in the linked list starting from the head correspond to some downward path connected in the binary tree otherwise return False.In this cont
2020-10-27 20:25:03 149
原创 [leetcode] 1372. Longest ZigZag Path in a Binary Tree
DescriptionGiven a binary tree root, a ZigZag path for a binary tree is defined as follow:Choose any node in the binary tree and a direction (right or left).If the current direction is right then move to the right child of the current node otherwise mo
2020-10-27 13:38:36 202 1
原创 [leetcode] 1339. Maximum Product of Splitted Binary Tree
DescriptionGiven a binary tree root. Split the binary tree into two subtrees by removing 1 edge such that the product of the sums of the subtrees are maximized.Since the answer may be too large, return it modulo 10^9 + 7.Example 1:Input: root = [1,2,3,
2020-10-26 23:38:29 158
原创 [leetcode] 1325. Delete Leaves With a Given Value
DescriptionGiven a binary tree root and an integer target, delete all the leaf nodes with value target.Note that once you delete a leaf node with value target, if it’s parent node becomes a leaf node and has the value target, it should also be deleted (y
2020-10-26 22:23:17 182
原创 [leetcode] 1305. All Elements in Two Binary Search Trees
DescriptionGiven two binary search trees root1 and root2.Return a list containing all the integers from both trees sorted in ascending order.Example 1:Input: root1 = [2,1,4], root2 = [1,0,3]Output: [0,1,1,2,3,4]Example 2:Input: root1 = [0,-10,10],
2020-10-26 22:08:13 136
原创 [leetcode] 1261. Find Elements in a Contaminated Binary Tree
DescriptionGiven a binary tree with the following rules:root.val == 0If treeNode.val == x and treeNode.left != null, then treeNode.left.val == 2 * x + 1If treeNode.val == x and treeNode.right != null, then treeNode.right.val == 2 * x + 2Now the binar
2020-10-26 21:58:22 144
原创 [leetcode] 1302. Deepest Leaves Sum
DescriptionGiven a binary tree, return the sum of values of its deepest leaves.Example 1:Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8]Output: 15Constraints:The number of nodes in the tree is between 1 and 10^4.The value of nodes is betw
2020-10-26 21:45:24 149
原创 [leetcode] 1145. Binary Tree Coloring Game
DescriptionTwo players play a turn based game on a binary tree. We are given the root of this binary tree, and the number of nodes n in the tree. n is odd, and each node has a distinct value from 1 to n.Initially, the first player names a value x with
2020-10-26 19:34:38 220
原创 [leetcode] 1315. Sum of Nodes with Even-Valued Grandparent
DescriptionGiven a binary tree, return the sum of values of nodes with even-valued grandparent. (A grandparent of a node is the parent of its parent, if it exists.)If there are no nodes with an even-valued grandparent, return 0.Example 1:Input: root =
2020-10-26 18:58:10 167
原创 [leetcode] 1130. Minimum Cost Tree From Leaf Values
DescriptionGiven an array arr of positive integers, consider all binary trees such that:Each node has either 0 or 2 children;The values of arr correspond to the values of each leaf in an in-order traversal of the tree. (Recall that a node is a leaf if
2020-10-26 13:49:54 145
openfst-1.6.7.tar.gz
2020-05-06
RotateDemo.rar
2019-05-10
springboot getopenid demo
2019-03-13
pytorch 0.3.1 python3.6 CPU版本whl
2019-03-11
NUS-WIDE多标签分类数据集整理
2018-11-29
VGG_ILSVRC_16_layers_fc_reduced.h5
2018-11-07
Jetson-TX2 tensorflow-1.3.0-cp35-cp35m-linux_aarch64.whl
2017-12-25
bazel-0.6.1-dist.zip 下载
2017-11-15
Connectionist Temporal Classification: A Tutorial with Gritty Details
2017-09-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人