- 博客(29)
- 收藏
- 关注
原创 [LC][array][binary search]153. Find Minimum in Rotated Sorted Array
一、问题描述Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You ma
2017-12-22 23:41:23
140
原创 [LC][array][Binary Search] 278. First Bad Version
一、问题描述You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed
2017-12-22 22:24:51
154
原创 78. Subsets I && 90. Subsets II
一、问题描述Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.For example,If nums = [1,2,3], a s
2017-12-22 08:25:00
160
原创 [LC]3. Longest Substring Without Repeating Characters
一、问题描述Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the ans
2017-12-21 06:31:12
133
原创 [LC]202. happy numbers
一、问题描述Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of
2017-12-21 04:14:35
178
原创 [Search Engines笔记]17: Authority metrics
参考文档:[1] http://boston.lti.cs.cmu.edu/classes/11-642/[2] http://www.shuang0420.com/categories/NLP/Search-Engines/为啥要它?retrieval model大多只考虑page content的好坏,比如title url什么的,然而来自不同source的相似的con
2017-12-21 03:02:03
409
原创 [Search Engines笔记] 16: Ranked retrieval: Feature-based models
参考文档:Jamie的课件:http://boston.lti.cs.cmu.edu/classes/11-642/阿衡的SE笔记:http://www.shuang0420.com/categories/NLP/Search-Engines/为啥要Learning to Rank: 我们已经学习了很多的检索方法: Retrieval Models:Vec
2017-12-19 08:14:37
527
原创 [LC]345. Reverse Vowels of a String
一、问题描述Write a function that takes a string as input and reverse only the vowels of a string.Example 1:Given s = "hello", return "holle".Example 2:Given s = "leetcode", return "leotce
2017-12-02 11:17:41
169
原创 [LC]246. Strobogrammatic Number
一、问题描述A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).Write a function to determine if a number is strobogrammatic. The number is re
2017-11-30 11:33:18
198
原创 [LC]
一、问题描述Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people i
2017-11-30 10:41:13
146
原创 [LC]289. Game of Life
一、问题描述According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."Given a b
2017-11-30 09:20:04
217
原创 [LC]686. Repeated String Match
一、问题描述Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1.For example, with A = "abcd" and B = "
2017-11-30 08:12:52
170
原创 [LC] 66. Plus One
一、问题描述Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.
2017-11-29 09:03:39
123
原创 [LC]346. Moving Average from Data Stream
一、问题描述Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.For example,MovingAverage m = new MovingAverage(3);m.next(1) = 1m
2017-11-29 08:41:49
209
原创 [LC]463. Island Perimeter
一、问题描述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/vertically (not diagonally). The grid is
2017-11-26 11:35:03
150
原创 [LC]657. Judge Route Circle
一、问题描述Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place. The move sequence is
2017-11-26 10:44:52
169
原创 [LC] 224. Basic Calculator
一、问题描述Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integ
2017-11-26 10:33:01
253
原创 [LC][Array] 448. Find All Numbers Disappeared in an Array
一、问题描述Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in thi
2017-11-24 01:02:07
131
原创 [LC][Array]238. Product of Array Except Self
一、问题描述Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without divisio
2017-11-19 11:16:10
153
原创 [LC]121. Best Time to Buy and Sell Stock
一、问题描述Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of
2017-11-18 23:18:04
133
原创 [LC]13. Roman to Integer
一、问题描述Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.roman numerals:http://literacy.kent.edu/Minigrants/Cinci/romanchart.htm
2017-11-18 22:07:41
120
原创 [LC][array] Add to List 561. Array Partition I
一、问题描述Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 t
2017-11-17 12:01:53
169
原创 [LC][Array]283. Move Zeroes
一、问题描述Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after
2017-11-17 11:28:36
107
原创 [LC]461. Hamming Distance
一、问题描述The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.No
2017-11-17 10:19:35
168
原创 [LC][Linked List]203. Remove Linked List Elements
问题描述:Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5解法:1)
2017-10-31 10:43:05
180
原创 [LC解题报告]16. 3Sum Closest
问题描述:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would
2017-10-27 10:13:48
128
原创 【LC解题报告】11. Container With Most Water
题目描述:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i
2017-10-27 08:19:00
166
原创 [笔记-0]写在最前+笔记大纲
0. 废话上这门课半学期了,从刚开始的一头雾水,到现在非常喜欢它,收获很大。教授是在这个领域很有经验,课程设计很合理,讲得也很有条理很清晰。Jamie人也超可爱的~打算最近把前半学期的内容按照Jamie给的系统示意图中的模块整理出来,避免考完了就还给他了…好啦,不多讲啦,开始正题~-------------------------------------------------
2017-10-20 09:35:48
398
原创 [笔记] Introduction to Shallow Language Processing
Bag of Words解释:搜素引擎用词袋模型这种shallow form理解语言。词袋模型的特征有:1)忽略word order;2)忽略stopwords(像the,a这种频率高又没什么实际意义的词);3)把words变成terms,将root相同的words变成一个term,比如cats->cat优缺点:pros:简单;有效c
2017-10-16 08:02:32
274
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人