自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

魔豆(Magicbean)的博客

分享计算机专业的相关知识

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

原创 [Leetcode] 477. 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 to find the total Hamming distance between all pairs o

2017-11-29 17:13:26 275

原创 [Leetcode] 476. Number Complement 解题报告

题目:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within t

2017-11-29 16:38:35 219

原创 [Leetcode] 475. 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 positions of houses and heaters on a ho

2017-11-29 16:10:22 282

原创 [Leetcode] 474. 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 are a dominator of m 0s and n 1s respectively.

2017-11-29 15:51:45 319

原创 [Leetcode] 473. 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 can make one square by using up all those matchsticks.

2017-11-28 21:32:44 391

原创 [Leetcode] 472. Concatenated Words 解题报告

题目:Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words.A concatenated word is defined as a string that is compri

2017-11-24 17:12:25 1564

原创 [Leetcode] 471. Encode String with Shortest Length 解题报告

题目:Given a non-empty string, encode the string such that its encoded length is the shortest.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is

2017-11-24 16:42:56 2337

原创 [Leetcode] 469. Convex Polygon 解题报告

题目:Given a list of points that form a polygon when joined sequentially, find if this polygon is convex (Convex polygon definition).Note:There are at least 3 and at most 10,000 points.C

2017-11-21 15:44:15 2034

原创 [Leetcode] 468. Validate IP Address 解题报告

题目:Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither.IPv4 addresses are canonically represented in dot-decimal notation, which consists of

2017-11-21 15:10:55 395

原创 [Leetcode] 467. Unique Substrings in Wraparound String 解题报告

题目:Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd....".

2017-11-21 14:26:54 247

原创 [Leetcode] 466. Count The Repetitions 解题报告

题目:Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc", 3] ="abcabcabc".On the other hand, we define that string s1 can be obtained from string s2

2017-11-21 11:27:07 861

原创 [Leetcode] 465. 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 Chris gave Alice $5 for a taxi ride. We can model each tra

2017-11-20 16:57:00 4074

原创 [Leetcode] 464. 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 or exceed 100 wins.What if we change t

2017-11-20 15:13:33 1067

原创 [Leetcode] 463. 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 horizontally/vertically (not diagonally). The grid is co

2017-11-20 14:14:42 206

原创 [Leetcode] 462. 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 move is incrementing a selected element by 1 or decrementing a selected el

2017-11-20 13:57:01 247

原创 [Leetcode] 461. Hamming Distance 解题报告

题目:The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:

2017-11-17 15:20:28 331

原创 [Leetcode] 460. LFU Cache 解题报告

题目:Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) o

2017-11-17 15:12:41 1591

原创 [Leetcode] 459. 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 together. You may assume the given string consists of lowerc

2017-11-14 16:32:58 275

原创 [Leetcode] 456. 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 algorithm that takes a list of n numbers as input

2017-11-14 16:15:47 1736

原创 [Leetcode] 455. 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 has a greed factor gi, which is the minimum si

2017-11-14 15:36:24 233

原创 [Leetcode] 454. 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 problem a bit easier, all A, B, C, D hav

2017-11-13 16:47:13 267

原创 [Leetcode] 453. 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, where a move is incrementing n - 1 elements by 1.Example:Input:[1

2017-11-13 15:45:33 201

原创 [Leetcode] 452. 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 start and end coordinates of the horizontal diameter. Since it's horizontal,

2017-11-13 15:21:08 258

原创 [Leetcode] 451. Sort Characters By Frequency 解题报告

题目:Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Explanation:'e' appears twice while 'r' and 't' both appear on

2017-11-13 14:16:35 252

原创 [Leetcode] 450. 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 updated) of the BST.Basically, the deletion can be

2017-11-13 14:07:35 225

原创 [Leetcode] 449. 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 or memory buffer, or transmitted across a network connection l

2017-11-10 17:21:51 356

原创 [Leetcode] 448. 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.Find all the elements of [1, n] inclusive that do not appear in this a

2017-11-10 17:19:36 270

原创 [Leetcode] 447. 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 iand j equals the distance between i and k (the o

2017-11-10 17:11:43 213

原创 [Leetcode] 446. 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 consecutive elements is the same.For example, these are arithmet

2017-11-10 16:04:58 580

原创 [Leetcode] 445. Add Two Numbers II 解题报告

题目:You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two numbers and

2017-11-10 15:09:59 222

原创 [Leetcode] 444. Sequence Reconstruction 解题报告

题目:Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 104. Reconstr

2017-11-10 10:31:35 1812

原创 [Leetcode] 443. String Compression 解题报告

题目:Given an array of characters, compress it in-place.The length after compression must always be smaller than or equal to the original array.Every element of the array should be a chara

2017-11-10 10:09:37 1284

原创 [Leetcode] 442. Find All Duplicates in an Array 解题报告

题目: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it withou...

2017-11-10 09:47:49 197

原创 [Leetcode] 441. 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 total number of full staircase rows that can be fo

2017-11-09 17:02:20 288

原创 [Leetcode] 440. K-th Smallest in Lexicographical Order 解题报告

题目:Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n.Note: 1 ≤ k ≤ n ≤ 109.Example:Input:n: 13 k: 2Output:10Explanation:The l

2017-11-09 16:39:21 1238

原创 [Leetcode] 439. Ternary Expression Parser 解题报告

题目:Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expression is valid and only consists of digit

2017-11-08 15:31:38 432

原创 [Leetcode] 438. Find All Anagrams in a String 解题报告

题目:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowercase English letters only and the length of both strings s and p will n

2017-11-08 11:19:42 380

原创 [Leetcode] 437. Path Sum III 解题报告

题目:You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a lea

2017-11-08 11:14:11 288

原创 [Leetcode] 436. Find Right Interval 解题报告

题目:Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the interval i, which can be called tha

2017-11-08 11:00:44 248

原创 [Leetcode] 435. Non-overlapping Intervals 解题报告

题目:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may assume the interval's end poi

2017-11-08 10:44:48 304

空空如也

空空如也

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

TA关注的人

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