摘要:
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
摘要:
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
摘要:
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
摘要:
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
摘要:
You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot turn around an 阅读全文
摘要:
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 阅读全文
摘要:
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appea 阅读全文
摘要:
Given a binary search tree and a node in it, find the in-order successor of that node in the BST. The successor of a node p is the node with the small 阅读全文
摘要:
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
摘要:
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia 阅读全文