关闭

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. ...
阅读(284) 评论(0)

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) - ...
阅读(686) 评论(0)

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...
阅读(255) 评论(0)

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...
阅读(360) 评论(0)

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,...
阅读(172) 评论(0)

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...
阅读(613) 评论(0)

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 ...
阅读(431) 评论(0)

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...
阅读(629) 评论(0)

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...
阅读(709) 评论(0)

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 ...
阅读(471) 评论(0)

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...
阅读(347) 评论(0)

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...
阅读(397) 评论(0)

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...
阅读(821) 评论(0)

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...
阅读(1282) 评论(0)

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: ...
阅读(384) 评论(0)

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...
阅读(881) 评论(0)

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...
阅读(725) 评论(0)

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...
阅读(342) 评论(0)

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...
阅读(390) 评论(0)

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...
阅读(817) 评论(0)
431条 共22页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:223112次
    • 积分:6360
    • 等级:
    • 排名:第4222名
    • 原创:431篇
    • 转载:0篇
    • 译文:0篇
    • 评论:6条
    文章分类
    最新评论