随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 7 ··· 61 下一页
摘要:Given a string s. Return all the words vertically in the same order in which they appear in s. Words are returned as a list of strings, complete with  阅读全文
posted @ 2022-12-10 20:02 Grandyang 阅读(157) 评论(0) 推荐(0)
摘要:You are given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit (6* become 阅读全文
posted @ 2022-12-04 07:44 Grandyang 阅读(249) 评论(0) 推荐(0)
摘要:You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate. For example, the letter 阅读全文
posted @ 2022-11-21 04:00 Grandyang 阅读(948) 评论(0) 推荐(0)
摘要:There are n computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connections[i] = [ai, bi] represents a 阅读全文
posted @ 2022-11-07 15:31 Grandyang 阅读(835) 评论(0) 推荐(0)
摘要:Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation). Flip 阅读全文
posted @ 2022-10-17 04:00 Grandyang 阅读(375) 评论(0) 推荐(0)
摘要:No-Zero integer is a positive integer that does not contain any 0 in its decimal representation. Given an integer n, return a list of two integers [A, 阅读全文
posted @ 2022-10-06 12:40 Grandyang 阅读(406) 评论(0) 推荐(0)
摘要:Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with itself (i.e. it can be written 阅读全文
posted @ 2022-10-02 05:00 Grandyang 阅读(364) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nodes with an even-valued grandpar 阅读全文
posted @ 2022-08-31 12:50 Grandyang 阅读(264) 评论(0) 推荐(0)
摘要:Given a m x n matrix mat and an integer k, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for: i - k <= r <= i + 阅读全文
posted @ 2022-08-17 13:45 Grandyang 阅读(498) 评论(0) 推荐(0)
摘要:We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pair of elements [freq, val] = [n 阅读全文
posted @ 2022-08-11 14:03 Grandyang 阅读(223) 评论(0) 推荐(0)
摘要:Given a string s. In one step you can insert any character at any index of the string. Return the minimum number of steps to make s palindrome. A Pali 阅读全文
posted @ 2022-08-06 12:25 Grandyang 阅读(547) 评论(0) 推荐(0)
摘要:There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where watchedVideos[i] and friends[i] c 阅读全文
posted @ 2022-07-23 10:34 Grandyang 阅读(377) 评论(0) 推荐(0)
摘要:Given an equation, represented by words on the left side and the result on the right side. You need to check if the equation is solvable under the fol 阅读全文
posted @ 2022-07-15 12:29 Grandyang 阅读(455) 评论(0) 推荐(0)
摘要:You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti]. For each query i compute the 阅读全文
posted @ 2022-07-08 21:24 Grandyang 阅读(305) 评论(0) 推荐(0)
摘要:You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows: Characters ('a' to 'i') are represente 阅读全文
posted @ 2022-06-27 06:10 Grandyang 阅读(242) 评论(0) 推荐(0)
摘要:Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + ar 阅读全文
posted @ 2022-06-12 14:25 Grandyang 阅读(586) 评论(0) 推荐(0)
摘要:Given an integer n, return any array containing n unique integers such that they add up to 0. Example 1: Input: n = 5 Output: [-7,-1,1,3,4] Explanatio 阅读全文
posted @ 2022-06-04 12:28 Grandyang 阅读(291) 评论(0) 推荐(0)
摘要:Given two binary search trees root1 and root2, return a list containing all the integers from both trees sorted in ascending order. Example 1: Input: 阅读全文
posted @ 2022-05-29 14:16 Grandyang 阅读(363) 评论(0) 推荐(0)
摘要:Given the root of 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] O 阅读全文
posted @ 2022-05-26 10:15 Grandyang 阅读(339) 评论(0) 推荐(0)
摘要:You are given a square board of characters. You can move on the board starting at the bottom right square marked with the character 'S'. You need to r 阅读全文
posted @ 2022-05-23 12:47 Grandyang 阅读(375) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 61 下一页
Fork me on GitHub