自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

htdwade的博客

记录个人工作学习中的心得

  • 博客(8)
  • 收藏
  • 关注

原创 LeetCode题解 —— 7. 整数反转

题目描述给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。示例 1:输入: 123输出: 321示例 2:输入: -123输出: -321示例 3:输入: 120输出: 21注意:假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−2^31, 2^31 − 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。解题思想...

2018-11-22 22:26:09 165

原创 LeetCode题解 —— 6. Z 字形变换

题目描述The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P ...

2018-05-24 10:37:20 216

转载 C++ 输入ctrl+z 不能再使用cin的问题

转载自http://www.cnblogs.com/hubavyn/p/3996413.html问题介绍: 程序步骤是开始往容器里面写数据,以Ctrl+Z来终止输入流,然后需要输入一个数据,来判断容器中是否有这个数据。源代码如下:#include<iostream>#include<map>#include<string>#include<vector>using namespace std

2018-05-23 22:05:33 878

原创 LeetCode题解 —— 5. 最长回文子串

题目描述Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: &amp;amp;quot;babad&amp;amp;quot;Output: &amp;amp;quot;bab&amp;amp;quot;Note: &amp;amp;quo

2018-05-23 21:59:02 178

原创 LeetCode题解 —— 4. 寻找两个有序数组的中位数

There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).example1nums1 = [1, 3]nums2 =

2018-05-22 22:59:02 406

原创 LeetCode题解 —— 3. 无重复字符的最长子串

Given a string, find the length of the longest substring without repeating characters.exampleGiven “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”, with the leng

2018-05-22 22:55:53 300

原创 LeetCode题解 —— 2. 两数相加

题目描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and re...

2018-05-22 22:50:50 163

原创 LeetCode题解 —— 1. 两数之和

题目描述Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the...

2018-05-22 22:49:55 302

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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