- 博客(6)
- 资源 (2)
- 收藏
- 关注
原创 leetcode 67. Add Binary
For example, a = “11” b = “1” Return “100”.class Solution(object): def swap(self,a,b): a1,b1=list(a),list(b) a1.reverse() b1.reverse() max_num=max(len(a1),
2016-06-29 19:31:18 213
原创 leetcode 68. Text Justification
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is
2016-06-29 17:16:28 216
原创 leetcode 14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.尴尬,一开始没懂题目意思。。。是时候好好学英语了!class Solution(object): def longestCommonPrefix(self, strs): """ :typ
2016-06-29 15:58:34 202
原创 leetcode 17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit strin
2016-06-29 12:33:28 235
原创 Leetcode93. Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given “25525511135”, return [“255.255.11.135”, “255.255.111.35”]. (Order
2016-06-29 12:00:01 399
原创 leetcode练习笔记
leetcode 344. Reverse String Write a function that takes a string as input and returns the string reversed. Example: Example: Given s = “hello”, return “olleh”.思路:将字符串转化为列表,利用列表的revers
2016-06-26 13:43:11 718
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人