摘要:
题目Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.分析一个简单的字符串相加,该题目要注意两点:字符位的求和计算...
阅读全文
posted @ 2015-08-19 20:58
Coding菌
阅读(142)
推荐(0)
摘要:
题目Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant ...
阅读全文
posted @ 2015-08-18 15:38
Coding菌
阅读(120)
推荐(0)
摘要:
题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were ins...
阅读全文
posted @ 2015-08-17 16:28
Coding菌
阅读(132)
推荐(0)
摘要:
题目Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be...
阅读全文
posted @ 2015-08-17 16:03
Coding菌
阅读(125)
推荐(0)
摘要:
题目Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -...
阅读全文
posted @ 2015-08-15 21:32
Coding菌
阅读(120)
推荐(0)
摘要:
题目Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.If the...
阅读全文
posted @ 2015-08-15 21:08
Coding菌
阅读(115)
推荐(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 assum...
阅读全文
posted @ 2015-08-15 20:47
Coding菌
阅读(102)
推荐(0)
摘要:
题目Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For ex...
阅读全文
posted @ 2015-08-13 21:38
Coding菌
阅读(177)
推荐(0)
摘要:
题目Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is ...
阅读全文
posted @ 2015-08-13 16:12
Coding菌
阅读(119)
推荐(0)
摘要:
题目Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11...
阅读全文
posted @ 2015-08-12 17:36
Coding菌
阅读(166)
推荐(0)