DinnerHowe的博客

DinnerHowe的博客

leetcode:3 Longest_Substring_Without_Repeating_Characters

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is &...

2017-03-04 18:37:07

阅读数:208

评论数:0

leetcode: string_compress

突然想到一个题目,有一组字符串s='aaaabbbccccabsdsdaaadddddd' 要求对该字符串进行压缩,并且空间复杂度最小例如:s的压缩结果是:‘a4b3c4absdsda3d6’代码如下:class Solution: def str_compress(self, s): ...

2017-03-04 17:22:40

阅读数:303

评论数:0

leetcode: 2 Add_Two_Numbers

第二题,没什么复杂的直接上代码好了,简单说就是首先两个链表相加,然后反向存储,最后转化成list输出#!/usr/bin/env python # -*- coding:utf-8 -*- """ Copyright (c) 2017 Xu Z...

2017-02-27 18:47:31

阅读数:291

评论数:0

leetcode: 1 Two Sum

最近开始刷leetcode, 这是第一题,没什么复杂的直接上代码好了题目是:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You ma...

2017-02-27 14:40:41

阅读数:514

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭