随笔分类 -  Hash Table

摘要:Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. Example 1: Note: Approach #1: Has 阅读全文 »
posted @ 2019-04-12 22:00 Veritas_des_Liberty 阅读(441) 评论(0) 推荐(0) 编辑
摘要:You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists. We define 阅读全文 »
posted @ 2018-11-20 19:48 Veritas_des_Liberty 阅读(258) 评论(0) 推荐(0) 编辑
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文 »
posted @ 2018-11-20 15:54 Veritas_des_Liberty 阅读(252) 评论(0) 推荐(0) 编辑
摘要:Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文 »
posted @ 2018-11-19 21:47 Veritas_des_Liberty 阅读(222) 评论(0) 推荐(0) 编辑
摘要:We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly1. Now, given an integer array 阅读全文 »
posted @ 2018-11-19 20:48 Veritas_des_Liberty 阅读(179) 评论(0) 推荐(0) 编辑
摘要:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文 »
posted @ 2018-11-19 18:19 Veritas_des_Liberty 阅读(196) 评论(0) 推荐(0) 编辑
摘要:There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. Yo 阅读全文 »
posted @ 2018-11-19 18:00 Veritas_des_Liberty 阅读(193) 评论(0) 推荐(0) 编辑
摘要:TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文 »
posted @ 2018-11-19 12:16 Veritas_des_Liberty 阅读(285) 评论(0) 推荐(0) 编辑
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: Note: The length of the giv 阅读全文 »
posted @ 2018-11-19 10:41 Veritas_des_Liberty 阅读(213) 评论(0) 推荐(0) 编辑
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文 »
posted @ 2018-11-19 09:11 Veritas_des_Liberty 阅读(193) 评论(0) 推荐(0) 编辑
摘要:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文 »
posted @ 2018-11-19 08:09 Veritas_des_Liberty 阅读(199) 评论(0) 推荐(0) 编辑
摘要:We are given non-negative integers nums[i] which are written on a chalkboard. Alice and Bob take turns erasing exactly one number from the chalkboard, 阅读全文 »
posted @ 2018-11-17 16:36 Veritas_des_Liberty 阅读(236) 评论(0) 推荐(0) 编辑
摘要:There are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations: When we serve some so 阅读全文 »
posted @ 2018-11-17 15:49 Veritas_des_Liberty 阅读(245) 评论(0) 推荐(0) 编辑
摘要:A website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com 阅读全文 »
posted @ 2018-11-17 12:04 Veritas_des_Liberty 阅读(164) 评论(0) 推荐(0) 编辑
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3: Approach #1: c++. 阅读全文 »
posted @ 2018-11-16 22:36 Veritas_des_Liberty 阅读(249) 评论(0) 推荐(0) 编辑
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文 »
posted @ 2018-11-16 22:25 Veritas_des_Liberty 阅读(273) 评论(0) 推荐(0) 编辑
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文 »
posted @ 2018-11-16 19:09 Veritas_des_Liberty 阅读(250) 评论(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 @ 2018-11-16 15:49 Veritas_des_Liberty 阅读(184) 评论(0) 推荐(0) 编辑
摘要:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文 »
posted @ 2018-11-16 15:03 Veritas_des_Liberty 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. Example: Approach #1: C++. 阅读全文 »
posted @ 2018-11-15 22:33 Veritas_des_Liberty 阅读(214) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示