_david李dvd

导航

2020年2月1日 #

Python版[leetcode]5. 最长回文子串(难度中等)

摘要: 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。 示例 1: 输入: "babad"输出: "bab"注意: "aba" 也是一个有效答案。示例 2: 输入: "cbbd"输出: "bb" 先贴一个我自己写的超出时间限制的算法: class Solution: 阅读全文

posted @ 2020-02-01 17:51 _david李dvd 阅读(554) 评论(0) 推荐(0)

Python版[leetcode]4. 寻找两个有序数组的中位数(难度困难)

摘要: 给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 示例 1: nums1 = [1, 3]nums2 = [2] 则中位数是 2.0示 阅读全文

posted @ 2020-02-01 17:38 _david李dvd 阅读(523) 评论(0) 推荐(0)

Python版[leetcode]3. 无重复字符的最长子串(难度中等)

摘要: 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。示例 2: 输入: "bbbbb"输出: 1解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。示例 3: 阅读全文

posted @ 2020-02-01 01:13 _david李dvd 阅读(307) 评论(0) 推荐(0)

Python版[leetcode]2. 两数相加(难度中等)

摘要: 给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 您可以假设除了数字 0 之外,这两个数都不会以 0 开头。 示例: 输入:(2 -> 4 -> 阅读全文

posted @ 2020-02-01 00:57 _david李dvd 阅读(313) 评论(0) 推荐(0)

Python版[leetcode]1. 两数之和(难度简单)

摘要: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 num 阅读全文

posted @ 2020-02-01 00:43 _david李dvd 阅读(608) 评论(0) 推荐(0)

2017年10月6日 #

Mac下部署Ionic环境

摘要: 1、下载安装nodejs,可以到官网http://nodejs.org/en/download/上去下载最新版本安装,比较无脑。如果官网打不开的话可以到中文网站去下载http://nodejs.cn/download/。安装完成之后打开终端(控制台)输入node -v查看node版本npm -v查看 阅读全文

posted @ 2017-10-06 22:42 _david李dvd 阅读(121) 评论(0) 推荐(0)

2016年1月7日 #

Longest Substring Without Repeating Characters (c#)

摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文

posted @ 2016-01-07 00:07 _david李dvd 阅读(176) 评论(0) 推荐(0)

2016年1月6日 #

Add Two Numbers (c#)

摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文

posted @ 2016-01-06 21:25 _david李dvd 阅读(327) 评论(0) 推荐(0)

Two Sum (c#)

摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文

posted @ 2016-01-06 21:07 _david李dvd 阅读(183) 评论(0) 推荐(0)