这题我做的时候用了动态规划,但是也只是能满足时间复杂度小于O(N2),先看下题目 Given an unsorted array of integers, find the length of lon...
You are playing the following Bulls and Cows game with your friend: You write down a number and ask ...
又是一道single number题目,这类题目一般都是依赖位操作,先给出题目: Given an array of numbers nums , in which exactly two eleme...
一道初看上去有点儿难度的题目,其实想明白了也不算太难。首先上题目: Given a string of numbers and operators, return all possible resul...
先看题目: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand....
这题和Maximum subarray很相似,一看到就想到是一个DP问题,首先给出题目: Given an integer array nums , find the contiguous subar...
从昨晚开始开始断断续续读这本书了。在刚毕业的那时候读过windows核心编程,里面也有不少内核的知识,但是那本书偏重windows以及编码,对操作系统的实现涉及不多,今年反正是充电的一年,leetco...
一道在链表上进行插入排序的题目,假设在数组上,插入排序的写法不难,但是数据结构改为链表,还是有点儿麻烦的。首先看下题目: Sort a linked list using insertion sort...
又是一道动态规划的题目,当然个人感觉不那么明显,但是也有递推的逻辑存在。 Given a non-empty string s and a dictionary wordDict containing...