自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(68)
  • 收藏
  • 关注

原创 移动硬盘无法移动文件到Mac图标为灰色

问题1.Mac不支持ntfs格式的存储介质的“写”操作,即无法将文件写到移动硬盘或者u盘中解决方法:下载第三方的一些软件,搜索“ntfs for mac”后可根据个人需求下载相应的软件。(有收费,有免费)问题2.当通过下载第三方软件获得“写”操作后,无法将文件移动到Mac中,如表呈现灰色。(不能更改“xxxxxx”中的一个或多个项目,因为它们正在使用中。)点击继续后,发现当进度条完成后,Mac上并没

2017-09-27 11:09:55 9517

原创 LeetCode 409. Longest Palindrome

Longest Palindrome题目描述:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive

2017-09-26 12:47:53 327

原创 LeetCode 389. Find the Difference

Find the Difference题目描述:Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position

2017-09-26 11:51:02 332

原创 LeetCode 350. Intersection of Two Arrays II

Intersection of Two Arrays II题目描述:Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each ele

2017-09-26 11:45:50 269

原创 LeetCode 349. Intersection of Two Arrays

Intersection of Two Arrays题目描述:Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each eleme

2017-09-26 11:41:26 368

原创 LeetCode 290. Word Pattern

Word Pattern题目描述:Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a

2017-09-24 11:42:48 282

原创 LeetCode 242. Valid Anagram

Valid Anagram题目描述:Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return fals

2017-09-24 11:37:44 250

原创 LeetCode 205. Isomorphic Strings

Isomorphic Strings题目描述:Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character

2017-09-24 11:37:05 244

原创 LeetCode 204. Count Primes

Count Primes题目描述:Description:Count the number of prime numbers less than a non-negative number, n.题目思路:题目给出一个数字n,求出小于n的素数的个数。打表晒素数,统计素数的个数返回即可。题目代码:class Solution {public:

2017-09-24 11:30:16 262

原创 LeetCode 136. Single Number

Single Number题目描述:Given an array of integers, every element appears twice except for one. Find that single one.题目思路:找出给定数组中只出现一次的元素,别的元素都出现过两次。使用异或运算,两个相同的数做异或运算等于0,0和非0的数做异或运算等于这个数。

2017-09-21 17:56:08 250

原创 LeetCode 202. Happy Number

Happy Number题目描述:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number

2017-09-21 17:43:01 332

原创 LeetCode 160. Intersection of Two Linked Lists

Intersection of Two Linked Lists题目描述:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A:

2017-09-19 22:43:48 390

原创 LeetCode 234. Palindrome Linked List

Palindrome Linked List题目描述:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?题目思路:给定一个链表给定头指针,判断这个链表是否是“回文”链表。我们

2017-09-19 11:42:51 435

原创 LeetCode 142. Linked List Cycle II

Linked List Cycle II题目思路判断给定链表中是否存在环,如果存在环返回环的起点。参考这篇文章。题目代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x

2017-09-18 15:39:07 502

原创 LeetCode 141. Linked List Cycle

Linked List Cycle题目思路:判断给定的链表中是否存在环。参考这篇文章题目代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next

2017-09-18 15:36:01 491

原创 LeetCode 21. Merge Two Sorted Lists

Merge Two Sorted Lists题目思路:题目要将两个排好序的链表合并。我们新声明一个指针,表示合并后链表的头节点元素的指针,最后返回头节点指针即可。我们再次声明一个指针,用来合并两个数组,我们可以依次将两个链表中较小的元素加到指针的后面,知道用完全部的元素。题目代码:/** * Definition for singly-linked list.

2017-09-18 15:30:30 473

原创 LeetCode 83. Remove Duplicates from Sorted List

Remove Duplicates from Sorted List题目描述:Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3

2017-09-18 15:26:59 470

原创 LeetCode 206. Reverse Linked List

Reverse Linked List题目思路:将题目给出的链表反转。使用中间变量将每个链表中元素的指向下一个元素的指针指向前一个元素即可。最后返回新的头指针节点。题目代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *nex

2017-09-18 15:21:26 501

原创 LeetCode 237. Delete Node in a Linked List

Delete Node in a Linked List题目描述: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 -> 2 -> 3 -> 4 an

2017-09-17 21:02:44 420

原创 LeetCode 203. Remove Linked List Elements

Remove Linked List Elements题目描述:Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,  val = 6Return: 1 --> 2 -->

2017-09-17 20:50:06 373

原创 LeetCode 287. Find the Duplicate Number

Find the Duplicate Number题目描述:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that

2017-09-16 19:35:11 658

原创 LeetCode 162. Find Peak Element

Find Peak Element题目描述:A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array

2017-09-13 14:50:02 537

原创 LeetCode 153. Find Minimum in Rotated Sorted Array

Find Minimum in Rotated Sorted Array题目描述:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).

2017-09-13 14:44:14 479

原创 LeetCode 106. Construct Binary Tree from Inorder and Postorder Traversal

Construct Binary Tree from Inorder and Postorder Traversal题目描述:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist

2017-09-13 14:39:58 682

原创 LeetCode 105. Construct Binary Tree from Preorder and Inorder Traversal

Construct Binary Tree from Preorder and Inorder Traversal题目描述:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in

2017-09-13 14:33:17 522

原创 LeetCode 11. Container With Most Water

Container With Most Water题目描述:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of

2017-09-12 09:51:36 384

原创 LeetCode 216. Combination Sum III

Combination Sum III题目描述:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of

2017-09-12 09:44:16 331

原创 LeetCode 40. Combination Sum II

Combination Sum II题目描述:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may onl

2017-09-12 09:39:04 336

原创 LeetCode 39. Combination Sum

Combination Sum题目描述:Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same rep

2017-09-12 09:32:21 387

原创 LeetCode 667. Beautiful Arrangement II

Beautiful Arrangement II 题目描述:Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requiremen

2017-09-12 09:27:23 636

原创 LeetCode 565. Array Nesting

Array Nesting题目描述:A zero-indexed array A consisting of N different integers is given. The array contains all integers in the range [0, N - 1]. Sets S[K] for 0 S[K] = { A[K], A[A[K]], A[A[A

2017-09-11 15:50:20 1507

原创 LeetCode 18. 4Sum

4Sum题目描述:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Not

2017-09-11 15:27:32 409

原创 LeetCode 16. 3Sum Closest

3Sum Closest题目描述:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that ea

2017-09-11 15:18:51 425

原创 LeetCode 15. 3Sum

3Sum题目描述:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set m

2017-09-11 15:11:06 433

原创 LeetCode 674. Longest Continuous Increasing Subsequence

Longest Continuous Increasing Subsequence题目描述:Given an unsorted array of integers, find the length of longest continuous increasing subsequence.Example 1:Input: [1,3,5,4,7]Output: 3

2017-09-10 20:58:26 378

原创 LeetCode 665. Non-decreasing Array

Non-decreasing Array题目描述:Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if ar

2017-09-09 10:49:15 2938

原创 LeetCode 661. Image Smoother

Image Smoother题目描述:Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the average gray scale (roundi

2017-09-09 10:35:39 1562

原创 LeetCode 643. Maximum Average Subarray I

Maximum Average Subarray I题目描述:Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximu

2017-09-09 10:30:53 690

原创 LeetCode 628. Maximum Product of Three Numbers

Maximum Product of Three Numbers题目描述:Given an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3]Output: 6Example 2:

2017-09-09 10:24:49 604

原创 LeetCode 605. Can Place Flowers

Can Place Flowers题目描述:Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they would compete for w

2017-09-09 10:20:00 722

空空如也

空空如也

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

TA关注的人

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