08 2018 档案
摘要:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. Th
阅读全文
摘要:Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be for
阅读全文
摘要:Koko loves to eat bananas. There are N piles of bananas, the i-th pile has piles[i] bananas. The guards have gone and will come back in H hours. Koko
阅读全文
摘要:Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put. get(key) - Get t
阅读全文
摘要:Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than
阅读全文
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 求两数相除,不能用乘法,除法和取余操作。 解法:位操作Bit Operati
阅读全文
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3: 给一个字符串按照字符出现的频率来排序。 Java: Python: P
阅读全文
摘要:A group of two or more people wants to meet and minimize the total travel distance. You are given a 2D grid of values 0 or 1, where each 1 marks the h
阅读全文
摘要:You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right.
阅读全文
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total
阅读全文
摘要: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
阅读全文
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping way: Beyond that, now the encoded string can also contai
阅读全文
摘要:Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Note: 解法1: Br
阅读全文
摘要:Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c
阅读全文
摘要:Given n processes, each process has a unique PID (process id) and its PPID (parent process id). Each process only has one parent process, but may have
阅读全文
摘要:The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users tabl
阅读全文
摘要:Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] +
阅读全文
摘要:Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step: Given a number n. You have to
阅读全文
摘要:Imagine you have a special keyboard with the following keys: Key 1: (A): Print one 'A' on screen. Key 2: (Ctrl-A): Select the whole screen. Key 3: (Ct
阅读全文
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two
阅读全文