随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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,
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号