随笔分类 - leetcode_hashTable
摘要:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic
阅读全文
摘要:Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating
阅读全文
摘要:Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the u
阅读全文
摘要:A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy
阅读全文
摘要:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to
阅读全文
摘要:Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According
阅读全文
摘要:You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time
阅读全文
摘要:Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit
阅读全文
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2:
阅读全文
摘要: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
阅读全文
摘要:Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l]is zero. To make prob
阅读全文
摘要:In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this word successor. For
阅读全文
摘要:Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum
阅读全文
摘要:Implement a magic directory with buildDict, and search methods. For the method buildDict, you'll be given a list of non-repetitive words to build a di
阅读全文
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3:
阅读全文
摘要: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
阅读全文
摘要:Given an array of integers, every element appears twice except for one. Find that single one. 题目含义:给定的数组中,每个数字出现两次,只有一个数字出现了一次,找出这个数字
阅读全文
摘要: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
阅读全文
摘要:We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra
阅读全文
摘要: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
阅读全文