摘要:
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: s = "leetcode" return 0. 阅读全文
posted @ 2016-09-28 15:25
Machelsky
阅读(121)
评论(0)
推荐(0)
摘要:
Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all mee 阅读全文
posted @ 2016-09-28 14:59
Machelsky
阅读(161)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2016-09-28 03:44
Machelsky
阅读(83)
评论(0)
推荐(0)
摘要:
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. 思路 阅读全文
posted @ 2016-09-28 03:41
Machelsky
阅读(115)
评论(0)
推荐(0)
摘要:
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 阅读全文
posted @ 2016-09-28 02:02
Machelsky
阅读(208)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2016-09-28 01:45
Machelsky
阅读(125)
评论(0)
推荐(0)