自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 LeetCode 448. Find All Numbers Disappeared in an Array

原题网址:https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.

2017-01-07 02:21:11 845

原创 LeetCode 460. LFU Cache

原题网址:https://leetcode.com/problems/lfu-cache/Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: getand put.get(key) -

2017-01-06 05:34:25 1669

原创 LeetCode 451. Sort Characters By Frequency

原题网址:https://leetcode.com/problems/sort-characters-by-frequency/Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Ex

2017-01-04 09:46:43 1008

原创 LeetCode 445. Add Two Numbers II

原题网址:https://leetcode.com/problems/add-two-numbers-ii/You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain

2017-01-04 09:33:07 889

原创 LeetCode 396. Rotate Function

原题网址:https://leetcode.com/problems/rotate-function/Given an array of integers A and let n to be its length.Assume Bk to be an array obtained by rotating the array A k positions clock-wise,

2017-01-04 09:06:31 562

原创 LeetCode 450. Delete Node in a BST

原题网址:https://leetcode.com/problems/delete-node-in-a-bst/Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly up

2017-01-04 08:36:18 950

原创 LeetCode 449. Serialize and Deserialize BST

原题网址:https://leetcode.com/problems/serialize-and-deserialize-bst/Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file

2017-01-04 06:39:45 823

原创 LeetCode 473. Matchsticks to Square

原题网址:https://leetcode.com/problems/matchsticks-to-square/Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you c

2016-12-26 04:05:48 1451

原创 LeetCode 477. Total Hamming Distance

原题网址:https://leetcode.com/problems/total-hamming-distance/The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Now your job is

2016-12-20 04:08:53 1009

原创 LeetCode 461. Hamming Distance

原题网址:https://leetcode.com/problems/hamming-distance/The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x 

2016-12-20 03:54:53 728

原创 LeetCode 434. Number of Segments in a String

原题网址:https://leetcode.com/problems/number-of-segments-in-a-string/Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.Ple

2016-12-20 03:42:35 601

原创 LeetCode 468. Validate IP Address

原题网址:https://leetcode.com/problems/validate-ip-address/方法:扫描检查,代码写得比较丑陋,暂时凑合着。public class Solution { private static final String NEITHER = "Neither"; private static final String IPV4 = "I

2016-12-15 06:07:59 679

原创 LeetCode 474. Ones and Zeroes

原题网址:https://leetcode.com/problems/ones-and-zeroes/In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.For now, suppose you a

2016-12-15 04:47:57 1445

原创 LeetCode 475. Heaters

原题网址:https://leetcode.com/problems/heaters/Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.Now, you are given

2016-12-12 04:00:28 2361

原创 467. Unique Substrings in Wraparound String

原题网址:https://leetcode.com/problems/unique-substrings-in-wraparound-string/Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this:

2016-12-06 05:32:55 651

原创 469. Convex Polygon

原题网址:https://leetcode.com/problems/convex-polygon/Given a list of points that form a polygon when joined sequentially, find if this polygon is convex (Convex polygon definition).Note:T

2016-12-05 03:36:00 1355

原创 446. Arithmetic Slices II - Subsequence

原题网址:https://leetcode.com/problems/arithmetic-slices-ii-subsequence/A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two con

2016-12-04 04:18:05 1277

原创 452. Minimum Number of Arrows to Burst Balloons

原题网址:https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the st

2016-12-02 02:33:50 582

原创 454. 4Sum II

原题网址:https://leetcode.com/problems/4sum-ii/Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make

2016-12-01 02:15:16 803

原创 456. 132 Pattern

原题网址:https://leetcode.com/problems/132-pattern/Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i j k and ai < ak j. Design an algori

2016-11-30 04:37:54 1586 1

原创 462. Minimum Moves to Equal Array Elements II

原题网址:https://leetcode.com/problems/minimum-moves-to-equal-array-elements-ii/Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a m

2016-11-27 03:27:16 591

原创 464. Can I Win

原题网址:https://leetcode.com/problems/can-i-win/In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach

2016-11-26 02:24:53 1039

原创 LeetCode 465. Optimal Account Balancing

原题网址:https://leetcode.com/problems/optimal-account-balancing/A group of friends went on holiday and sometimes lent each other money. For example, Alice paid for Bill's lunch for $10. Then later

2016-11-22 04:40:39 3582 1

原创 LeetCode 463. Island Perimeter

原题网址:https://leetcode.com/problems/island-perimeter/You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizon

2016-11-21 04:00:43 1472

原创 LeetCode 453. Minimum Moves to Equal Array Elements

原题网址:https://leetcode.com/problems/minimum-moves-to-equal-array-elements/Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, wh

2016-11-21 03:50:55 474

原创 LeetCode 447. Number of Boomerangs

原题网址:https://leetcode.com/problems/number-of-boomerangs/Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between 

2016-11-21 03:33:07 598

原创 LeetCode 459. Repeated Substring Pattern

原题网址:https://leetcode.com/problems/repeated-substring-pattern/Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring t

2016-11-19 04:33:02 562

原创 LeetCode 441. Arranging Coins

原题网址:https://leetcode.com/problems/arranging-coins/You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the to

2016-11-19 03:19:43 781

原创 LeetCode 400. Nth Digit

原题网址:https://leetcode.com/problems/nth-digit/Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...Note:n is positive and will fit within the range of a

2016-11-18 07:54:19 369

原创 LeetCode 455. Assign Cookies

原题网址:https://leetcode.com/problems/assign-cookies/Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i h

2016-11-17 04:25:32 518

原创 LeetCode 414. Third Maximum Number

原题网址:https://leetcode.com/problems/third-maximum-number/Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The t

2016-11-17 03:18:06 389

原创 LeetCode 408. Valid Word Abbreviation

原题网址:https://leetcode.com/problems/valid-word-abbreviation/Given a non-empty string s and an abbreviation abbr, return whether the string matches with the given abbreviation.A string such

2016-11-16 07:38:08 633

原创 405. Convert a Number to Hexadecimal

原题网址:https://leetcode.com/problems/convert-a-number-to-hexadecimal/Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.

2016-10-28 03:50:48 630

原创 415. Add Strings

原题网址:https://leetcode.com/problems/add-strings/Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2

2016-10-28 02:04:11 316

原创 401. Binary Watch

原题网址:https://leetcode.com/problems/binary-watch/A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).Each LED repr

2016-10-28 01:50:47 401

原创 409. Longest Palindrome

原题网址:https://leetcode.com/problems/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 let

2016-10-27 07:56:53 278

原创 387. First Unique Character in a String

原题网址:https://leetcode.com/problems/first-unique-character-in-a-string/Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examp

2016-10-27 05:07:35 307

原创 404. Sum of Left Leaves

原题网址:https://leetcode.com/problems/sum-of-left-leaves/Find the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in t

2016-10-27 04:51:54 293

原创 383. Ransom Note

原题网址:https://leetcode.com/problems/ransom-note/Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the r

2016-10-27 04:13:14 840

原创 389. Find the Difference

原题网址:https://leetcode.com/problems/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 m

2016-10-27 02:55:27 291

空空如也

空空如也

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

TA关注的人

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