随笔分类 -  leetcode

摘要:A popular masseuse receives a sequence of back-to-back appointment requests and is debating which ones to accept. She needs a break between appointmen 阅读全文
posted @ 2020-03-24 16:57 界757 阅读(546) 评论(0) 推荐(0)
摘要:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This 阅读全文
posted @ 2020-03-19 15:16 界757 阅读(119) 评论(0) 推荐(0)
摘要:Given an array A of integers, return true if and only if we can partition the array into three non-empty parts with equal sums. Formally, we can parti 阅读全文
posted @ 2020-03-11 17:17 界757 阅读(114) 评论(0) 推荐(0)
摘要:Given an integer number n, return the difference between the product of its digits and the sum of its digits. Example 1: Input: n = 234Output: 15 Expl 阅读全文
posted @ 2020-02-11 16:23 界757 阅读(110) 评论(0) 推荐(0)
摘要:We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pair of elements [a, b] = [nums[2 阅读全文
posted @ 2020-02-11 16:06 界757 阅读(116) 评论(0) 推荐(0)
摘要:Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896]Output: 2Explanat 阅读全文
posted @ 2020-02-10 17:14 界757 阅读(174) 评论(0) 推荐(0)
摘要:Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwis 阅读全文
posted @ 2020-02-10 16:12 界757 阅读(134) 评论(0) 推荐(0)
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2019-12-23 16:39 界757 阅读(165) 评论(0) 推荐(0)
摘要:Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the bi 阅读全文
posted @ 2019-12-18 16:10 界757 阅读(163) 评论(0) 推荐(0)
摘要:Given n and m which are the dimensions of a matrix initialized by zeros and given an array indices where indices[i] = [ri, ci]. For each pair of [ri, 阅读全文
posted @ 2019-11-19 15:57 界757 阅读(142) 评论(0) 推荐(0)
摘要:Balanced strings are those who have equal quantity of 'L' and 'R' characters. Given a balanced string s split it in the maximum amount of balanced str 阅读全文
posted @ 2019-10-16 16:09 界757 阅读(295) 评论(0) 推荐(0)