随笔分类 -  Leetcode

1 2 3 4 5 ··· 23 下一页
摘要:给你一个字符串 s ,每一次操作你都可以在字符串的任意位置插入任意字符。 请你返回让 s 成为回文串的 最少操作次数 。 「回文串」是正读和反读都相同的字符串。 示例 1: 输入:s = "zzazz"输出:0解释:字符串 "zzazz" 已经是回文串了,所以不需要做任何插入操作。示例 2: 输入: 阅读全文
posted @ 2021-04-16 21:30 Veritas_des_Liberty 阅读(150) 评论(0) 推荐(0) 编辑
摘要:Given 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 阅读全文
posted @ 2020-05-10 18:05 Veritas_des_Liberty 阅读(318) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers nums and an integer limit, return the size of the longest continuous subarray such that the absolute difference between any 阅读全文
posted @ 2020-05-03 18:22 Veritas_des_Liberty 阅读(543) 评论(0) 推荐(0) 编辑
摘要:You are given an m * n matrix, mat, and an integer k, which has its rows sorted in non-decreasing order. You are allowed to choose exactly 1 element f 阅读全文
posted @ 2020-05-03 17:28 Veritas_des_Liberty 阅读(225) 评论(0) 推荐(0) 编辑
摘要:1408. String Matching in an Array Given an array of string words. Return all strings in words which is substring of another word in any order. String  阅读全文
posted @ 2020-04-12 17:45 Veritas_des_Liberty 阅读(238) 评论(0) 推荐(0) 编辑
摘要:1071. Greatest Common Divisor of Strings For strings S and T, we say "T divides S" if and only if S = T + ... + T (T concatenated with itself 1 or mor 阅读全文
posted @ 2019-06-02 16:33 Veritas_des_Liberty 阅读(320) 评论(0) 推荐(0) 编辑
摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文
posted @ 2019-05-31 22:30 Veritas_des_Liberty 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). You also have several balls i 阅读全文
posted @ 2019-05-31 21:18 Veritas_des_Liberty 阅读(15212) 评论(0) 推荐(0) 编辑
摘要:Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one s 阅读全文
posted @ 2019-05-30 22:32 Veritas_des_Liberty 阅读(250) 评论(0) 推荐(0) 编辑
摘要:Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and 阅读全文
posted @ 2019-05-30 22:00 Veritas_des_Liberty 阅读(221) 评论(0) 推荐(0) 编辑
摘要:Given a number N, return a string consisting of "0"s and "1"s that represents its value in base -2 (negative two). The returned string must have no le 阅读全文
posted @ 2019-05-29 16:31 Veritas_des_Liberty 阅读(326) 评论(0) 推荐(0) 编辑
摘要:On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions: "G": go straight 1 unit; "L 阅读全文
posted @ 2019-05-29 15:53 Veritas_des_Liberty 阅读(377) 评论(0) 推荐(0) 编辑
摘要:Given an array A of non-negative integers, the array is squareful if for every pair of adjacent elements, their sum is a perfect square. Return the nu 阅读全文
posted @ 2019-05-28 22:04 Veritas_des_Liberty 阅读(278) 评论(0) 推荐(0) 编辑
摘要:On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; D 阅读全文
posted @ 2019-05-28 20:58 Veritas_des_Liberty 阅读(307) 评论(0) 推荐(0) 编辑
摘要:Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossib 阅读全文
posted @ 2019-05-27 22:35 Veritas_des_Liberty 阅读(202) 评论(0) 推荐(0) 编辑
摘要:1051. Height Checker Students are asked to stand in non-decreasing order of heights for an annual photo. Return the minimum number of students not sta 阅读全文
posted @ 2019-05-26 12:43 Veritas_des_Liberty 阅读(222) 评论(0) 推荐(0) 编辑
摘要:Given a set of points in the xy-plane, determine the minimum area of any rectangle formed from these points, with sides not necessarily parallel to th 阅读全文
posted @ 2019-05-24 22:13 Veritas_des_Liberty 阅读(273) 评论(0) 推荐(0) 编辑
摘要:Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. After this process, we have some array B 阅读全文
posted @ 2019-05-23 21:43 Veritas_des_Liberty 阅读(200) 评论(0) 推荐(0) 编辑
摘要:Let's say a positive integer is a superpalindrome if it is a palindrome, and it is also the square of a palindrome. Now, given two positive integers L 阅读全文
posted @ 2019-05-23 21:28 Veritas_des_Liberty 阅读(337) 评论(0) 推荐(0) 编辑
摘要:On a N * N grid, we place some 1 * 1 * 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of grid cell (i, j). Return the 阅读全文
posted @ 2019-05-23 20:30 Veritas_des_Liberty 阅读(258) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 23 下一页