1. 题目 Design and implement a data structure for Least Recently Used (LRU) cache. It should support the followi…
分类:LeetCode题目解答
LeetCode 280. Wiggle Sort II
Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]&…
[LeetCode] Find Mode in Binary Search Tree 找二分搜索数的众数
Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently o…
[LeetCode] K-diff Pairs in an Array 数组中差为K的数对
Given an array of integers and an integer k, you need to find the number of unique k-dif…
[LeetCode] Dota2 Senate 刀塔二参议院
In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 senate…
[LeetCode] Minimum Index Sum of Two Lists 两个表单的最小坐标和
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite re…
推荐朋友 - LintCode
拼多多笔试第三题 除了题目具体方法值得注意外,数据的输入格外注意 题目 描述 给n个人的朋友名单,告诉你user,请找出user最可能认识的人。(他和user有最多的共同好友且他不是user的朋友) n <= 50…
找一找
题目 https://www.nowcoder.com/acm/contest/71/A 题目描述 给定n个正整数,请找出其中有多少个数x满足:在这n个数中存在数y=kx,其中k为大于1的整数 输入描述: 第一行输入一个…
leetcode-111. Minimum Depth of Binary Tree
平时练习一下leetcode 先根据牛课网上题练习,同步leetcode官网 题目 Given a binary tree, find its minimum depth.The minimum depth is the…
[LeetCode] 3Sum 三数之和,Two Sum,Two Sum,Two Sum,Two Sum
Given an array S of n integers, are there elements a, b, c in&n…
[LeetCode] Perfect Number 完美数字
We define the Perfect Number is a positive integer that is equal to the sum of all its p…
[LeetCode] Letter Case Permutation 字母大小写全排列
Given a string S, we can transform every letter individually to be lowercase or uppercase to creat…