01 2018 档案
摘要:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in Sis a type of stone
阅读全文
摘要:leetcode-766-Toeplitz Matrix A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, ret
阅读全文
摘要:思路: 1.第一次扫描字符串,记录每个字符最后出现的索引。 2.第二次扫描,如果当前索引是该字符的最后出现的索引,则记录当前分割段的长度。 参考: https://discuss.leetcode.com/topic/117141/java-2-pass-o-n-time-o-1-space-ext
阅读全文
摘要:Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation
阅读全文
摘要:Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has m
阅读全文
摘要:Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A. We want to find
阅读全文
摘要:思路: 二分查找。 参考: https://leetcode.com/problems/find-smallest-letter-greater-than-target/discuss/110027
阅读全文
摘要:You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rota
阅读全文
摘要:In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as
阅读全文