摘要:
The API: int read4(char *buf) reads 4 characters at a time from a file.The return value is the actual number of characters read. For example, it retur 阅读全文
摘要:
Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitt 阅读全文
摘要:
Given two strings s and t, determine if they are both one edit distance apart.Note: There are 3 possiblities to satisify one edit distance apart:1. In 阅读全文
摘要:
Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for every word following rules below. 1. Begin wit 阅读全文
摘要:
Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation. A string such as "word" contains o 阅读全文
摘要:
A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given a non-empty strin 阅读全文
摘要:
Merge k sorted linked lists and return it as one sorted list.Analyze and describe its complexity.ExampleGiven lists:[ 2->4->null, null, -1->null],retu 阅读全文
摘要:
Given some points and a point origin in two dimensional space, find k points out of the some points which are nearest to origin. Return these points s 阅读全文
摘要:
Given an integer array, find the top k largest numbers in it. Example Given [3,10,1000,-99,4,100] and k = 3. Return [1000, 100, 10]. 1.用堆数据结构。O(nlogk) 阅读全文
摘要:
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window.ExampleMovingAverage m = new MovingAv 阅读全文