# Title Editorial Acceptance Difficulty Frequency 
 。 65 Valid Number     12.6% Hard  
 。 126 Word Ladder II     13.6% Hard  
 。 149 Max Points on a Line     15.6% Hard  
 。 146 LRU Cache     16.0% Hard  
 。 68 Text Justification     18.1% Hard  
 。 460 LFU Cache     19.0% Hard  
 。 44 Wildcard Matching     19.0% Hard  
 。 308 Range Sum Query 2D - Mutable     19.8% Hard  
 。 4 Median of Two Sorted Arrays     20.8% Hard  
 。 420 Strong Password Checker     21.0% Hard  
 。 273 Integer to English Words     21.1% Hard  
 。 30 Substring with Concatenation of All Words     21.7% Hard  
 。 440 K-th Smallest in Lexicographical Order     22.1% Hard  
 。 140 Word Break II     22.2% Hard  
 。 212 Word Search II     22.2% Hard  
 。 269 Alien Dictionary     22.3% Hard  
 。 174 Dungeon Game     22.9% Hard  
 。 214 Shortest Palindrome     23.0% Hard  
 。 446 Arithmetic Slices II - Subsequence     23.0% Hard  
 。 32 Longest Valid Parentheses     23.1% Hard  
 。 295 Find Median from Data Stream     23.3% Hard  
 。 132 Palindrome Partitioning II     23.4% Hard  
 。 10 Regular Expression Matching     23.6% Hard  
 。 76 Minimum Window Substring     23.8% Hard  
 。 188 Best Time to Buy and Sell Stock IV     23.8% Hard  
 。 321 Create Maximum Number     23.9% Hard  
 。 135 Candy     23.9% Hard  
 。 335 Self Crossing     23.9% Hard  
 。 97 Interleaving String     23.9% Hard  
 。 391 Perfect Rectangle     24.2% Hard  
 。 158 Read N Characters Given Read4 II - Call multiple times     24.4% Hard  
 。 466 Count The Repetitions     24.6% Hard  
 。 336 Palindrome Pairs     24.7% Hard  
 。 41 First Missing Positive     24.9% Hard  
 。 124 Binary Tree Maximum Path Sum     25.0% Hard  
 。 224 Basic Calculator     25.5% Hard  
 。 218 The Skyline Problem     25.5% Hard  
 。 84 Largest Rectangle in Histogram     25.6% Hard  
 。 23 Merge k Sorted Lists     25.9% Hard  
 。 45 Jump Game II     26.0% Hard  
 。 85 Maximal Rectangle     26.1% Hard  
 。 57 Insert Interval     26.3% Hard  
 。 138 Copy List with Random Pointer     26.6% Hard  
 。 233 Number of Digit One     27.3% Hard  
 。 381 Insert Delete GetRandom O(1) - Duplicates allowed     28.0% Hard  
 。 37 Sudoku Solver     28.1% Hard  
 。 432 All O`one Data Structure     28.2% Hard  
 。 87 Scramble String     28.3% Hard  
 。 123 Best Time to Buy and Sell Stock III     28.3% Hard  
 。 56 Merge Intervals     28.4% Hard  
 。 282 Expression Add Operators     28.5% Hard  
 。 316 Remove Duplicate Letters     28.6% Hard  
  164 Maximum Gap     28.6% Hard  
  99 Recover Binary Search Tree     28.7% Hard  
  327 Count of Range Sum     28.9% Hard  
  51 N-Queens     29.0% Hard  
  25 Reverse Nodes in k-Group     29.7% Hard  
  472 Concatenated Words     30.1% Hard  
  465 Optimal Account Balancing     30.1% Hard  
  248 Strobogrammatic Number III     30.5% Hard  
  72 Edit Distance     30.6% Hard  
  115 Distinct Subsequences     30.6% Hard  
  403 Frog Jump     30.9% Hard  
  411 Minimum Unique Word Abbreviation     31.1% Hard  
  239 Sliding Window Maximum     31.4% Hard  
  330 Patching Array     31.5% Hard  
  297 Serialize and Deserialize Binary Tree     31.6% Hard  
  354 Russian Doll Envelopes     31.8% Hard  
  358 Rearrange String k Distance Apart     31.8% Hard  
  33 Search in Rotated Sorted Array     31.9% Hard  
  363 Max Sum of Rectangle No Larger Than K     32.1% Hard  
  410 Split Array Largest Sum     32.2% Hard  
  480 Sliding Window Median     33.1% Hard  
  317 Shortest Distance from All Buildings     33.3% Hard  
  117 Populating Next Right Pointers in Each Node II     33.5% Hard  
  315 Count of Smaller Numbers After Self     33.5% Hard  
  301 Remove Invalid Parentheses     34.5% Hard  
  42 Trapping Rain Water     35.3% Hard  
  128 Longest Consecutive Sequence     35.3% Hard  
  329 Longest Increasing Path in a Matrix     35.4% Hard  
  407 Trapping Rain Water II     35.6% Hard  
  154 Find Minimum in Rotated Sorted Array II     36.2% Hard  
  265 Paint House II     37.1% Hard  
  272 Closest Binary Search Tree Value II     37.6% Hard  
  291 Word Pattern II     37.7% Hard  
  305 Number of Islands II     38.1% Hard  
  380 Insert Delete GetRandom O(1)     38.4% Hard  
  145 Binary Tree Postorder Traversal     38.4% Hard  
  340 Longest Substring with At Most K Distinct Characters     38.6% Hard  
  352 Data Stream as Disjoint Intervals     38.9% Hard  
  159 Longest Substring with At Most Two Distinct Characters     39.7% Hard  
  312 Burst Balloons     41.6% Hard  
  287 Find the Duplicate Number     41.8% Hard  
  425 Word Squares     41.9% Hard  
  52 N-Queens II     42.8% Hard  
  302 Smallest Rectangle Enclosing Black Pixels     44.0% Hard  
  471 Encode String with Shortest Length     44.2% Hard  
  296 Best Meeting Point     50.4% Hard
 。 45 Jump Game II     26.0% Hard

很好的题目。

https://discuss.leetcode.com/topic/3191/o-n-bfs-solution/2

85 Maximal Rectangle     26.1% Hard

这个解法真的是相当的好。

https://discuss.leetcode.com/topic/6650/share-my-dp-solution/2

233 Number of Digit One     27.3% Hard

这个解法非常好,也非常有技巧:

https://discuss.leetcode.com/topic/18054/4-lines-o-log-n-c-java-python

通过对某一个位置上面的1的个数累加,来完成。

57 Insert Interval     26.3% Hard

解法非常好。

http://www.cnblogs.com/charlesblc/p/6438698.html

37 Sudoku Solver     28.1% Hard

很好的解法:

https://discuss.leetcode.com/topic/11327/straight-forward-java-solution-using-backtracking

432 All O`one Data Structure     28.2% Hard

我也有大致的思路。这个里面的代码写的真是非常的精巧。

https://discuss.leetcode.com/topic/63827/c-solution-with-comments

class AllOne {
public: void inc(string key) { // If the key doesn't exist, insert it with value 0.
if (!bucketOfKey.count(key))
bucketOfKey[key] = buckets.insert(buckets.begin(), {, {key}}); // Insert the key in next bucket and update the lookup.
auto next = bucketOfKey[key], bucket = next++;
if (next == buckets.end() || next->value > bucket->value + )
next = buckets.insert(next, {bucket->value + , {}});
next->keys.insert(key);
bucketOfKey[key] = next; // Remove the key from its old bucket.
bucket->keys.erase(key);
if (bucket->keys.empty())
buckets.erase(bucket);
} void dec(string key) { // If the key doesn't exist, just leave.
if (!bucketOfKey.count(key))
return; // Maybe insert the key in previous bucket and update the lookup.
auto prev = bucketOfKey[key], bucket = prev--;
bucketOfKey.erase(key);
if (bucket->value > ) {
if (bucket == buckets.begin() || prev->value < bucket->value - )
prev = buckets.insert(bucket, {bucket->value - , {}});
prev->keys.insert(key);
bucketOfKey[key] = prev;
} // Remove the key from its old bucket.
bucket->keys.erase(key);
if (bucket->keys.empty())
buckets.erase(bucket);
} string getMaxKey() {
return buckets.empty() ? "" : *(buckets.rbegin()->keys.begin());
} string getMinKey() {
return buckets.empty() ? "" : *(buckets.begin()->keys.begin());
} private:
struct Bucket { int value; unordered_set<string> keys; };
list<Bucket> buckets;
unordered_map<string, list<Bucket>::iterator> bucketOfKey;
};

很不错。用了stl里面的list,然后用了里面的iterator,可以方便的++,--,insert和erase。

继续过Hard题目.周五的更多相关文章

  1. 3月2日 Linked List Cycle

    今天星期天,准备好周一的PPT内容,再回来做题,以后考虑周末做一个APP或者微信帐号玩吧. 回到题目, Linked List Cycle,一个检查单项链表是否有环路的问题. 题目周五的时候就简单做过 ...

  2. #一周五# VS2015 CTP6, TFS2015 CTP1更新,老衣的开发工具汇总,2015 MVP 社区巡讲

    又到周五,这一周博主我工作效率极高,每天更新博客一篇,<快速创建网站>系列已经进程大半了,希望这个系列能够对大家有所帮助.今天周五了,博主要休息一下,就给大家唠叨一下这段时间都发生了什么. ...

  3. #一周五# VS2015 CTP6, TFS2015 CTP1更新,老衣的开发工具汇总,2015 MVP 社区巡讲

    又到周五,这一周博主我工作效率极高,每天更新博客一篇,<快速创建网站>系列已经进程大半了,希望这个系列能够对大家有所帮助.今天周五了,博主要休息一下,就给大家唠叨一下这段时间都发生了什么. ...

  4. 软件工程课堂作业(五)——终极版随机产生四则运算题目(C++)

    一.升级要求:让程序能接受用户输入答案,并判定对错.最后给出总共对/错的数量. 二.设计思想: 1.首先输入答案并判断对错.我想到的是定义两个数组,一个存放用户算的结果,另一个存放正确答案.每输出一道 ...

  5. 软件工程课堂作业(二)续——升级完整版随机产生四则运算题目(C++)

    一.设计思想: 1.根据题目新设要求,我将它们分为两类:一类是用户输入数目,根据这个数目改变一系列后续问题:另一类是用户输入0或1,分情况解决问题. 2.针对这两类要求,具体设计思路已在上篇博文中写出 ...

  6. 从实力的角度出发来思考这道AOP题目

    文/楠木大叔 技术更迭,一往无前.技术人总是要不断学习以适应社会的发展和行业对我们的要求.每隔一段时间,就会有纷至沓来的新技术,新知识,新概念,我们应该如何应对,是被逼到墙角,还是主动出击? 导读 从 ...

  7. python基础练习题(题目 字母识词)

    day22 --------------------------------------------------------------- 实例031:字母识词 题目 请输入星期几的第一个字母来判断一 ...

  8. 谈谈一些有趣的CSS题目(十二)-- 你该知道的字体 font-family

    开本系列,谈谈一些有趣的 CSS 题目,题目类型天马行空,想到什么说什么,不仅为了拓宽一下解决问题的思路,更涉及一些容易忽视的 CSS 细节. 解题不考虑兼容性,题目天马行空,想到什么说什么,如果解题 ...

  9. 谈谈一些有趣的CSS题目(十一)-- reset.css 知多少?

    开本系列,谈谈一些有趣的 CSS 题目,题目类型天马行空,想到什么说什么,不仅为了拓宽一下解决问题的思路,更涉及一些容易忽视的 CSS 细节. 解题不考虑兼容性,题目天马行空,想到什么说什么,如果解题 ...

随机推荐

  1. JS生成数字加减乘法验证码

    给大家分享一个简单的js验证码生成代码 PS:该代码依赖Jquery1.4版本以上 传入元素 如productionVerificationCode(#\(("a")) 反回验证码 ...

  2. webpack不打包指定的js文件

    背景: 在项目实际开发中,有一些IP地址需要随时修改,进行部署,例如websocket的地址.因此在项目打包的时候,不希望保持IP地址的文件被打包,因此就需要把需要修改的常量独立出来,存放在一个js文 ...

  3. 使用Oracle Database Instant Client 精简版

    如果只为了在开发环境中访问Oracle,推荐使用Oracle Database Instant Client(精简版)它相对小巧且不需要安装绿色方便移植. 官方下载Instant Client,在Or ...

  4. APP热更新方案(转)

    本文转载自[http://creator.cnblogs.com/] 博客地址:Zealot Yin 为什么要做热更新 当一个App发布之后,突然发现了一个严重bug需要进行紧急修复,这时候公司各方就 ...

  5. 在Html5中与服务器交互

    转自原文 在Html5中与服务器交互 刚刚涉足职场,上头就要我研究HTML5,内嵌到手机上,这对我来说完全是一个陌生的领域,不过也正好给自己一个机会来学习,最近做到要跟服务器交互这部分,这部分可是卡了 ...

  6. HDU 3625

    有点置换群的味道. 当撞开一个门后,能打开一连串的门,即是可以排成一个圈.求的是种数,于是,可以使用第一类斯特林数,求出撞了0~K次的种数. 但是,注意,当第一个门为独自一个圈时,是不可行的,因为这代 ...

  7. Android蓝牙串口程序开发

    本文主要介绍了针对android的蓝牙串口上位机开发. 程序下载地址:点击打开链接 一.帧定义 androidclient依照一定的数据帧格式通过蓝牙串口发送数据到连接到MCU的蓝牙从机.MCU接收到 ...

  8. 数据结构与算法系列----最小生成树(Prim算法&amp;Kruskal算法)

     一:Prim算法       1.概览 普里姆算法(Prim算法).图论中的一种算法.可在加权连通图里搜索最小生成树.意即由此算法搜索到的边子集所构成的树中.不但包含了连通图里的全部顶点(英语:Ve ...

  9. OpenMp之reduction求和

    // OpenMP1.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include"omp.h" #include& ...

  10. 使用Ant打包Android应用具体解释

    计划写个完整的使用Ant打包Android应用的系列文章.三篇文章.首篇具体介绍採用Ant打包Android应用的流程.列出部分定制问题及其解决方法,第二篇介绍我理解的Ant打包的思路与主要的概念和使 ...