1 Star 1 Fork 1

Clock966 / LeetcodeEveryday

forked from 四方云和 / LeetcodeEveryday 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
GPL-2.0

Leetcode 学习与总结

一、电子书(pdf)

Latex排版整理的电子书



二、文档列表



三、所有题目列表

# TitleEN TitleCN Level Java C++ Python Go Remark
1 Two Sum Java解答
2 Add Two Numbers Java解答
3 Longest Substring Without Repeating Characters Java解答 这个系列的所有题都要多做几遍
4 Median of Two Sorted Arrays Java解答 这题很经典,多做几遍
5 Longest Palindromic Substring Java解答 这题对比动态规划和最优算法
6 ZigZag Conversion Java解答
7 Reverse Integer Java解答
8 String to Integer (atoi) Java解答 很考代码能力,容易错
9 Palindrome Number Java解答
10 Regular Expression Matching Java解答 这题很经典,多做几遍,和#44一起
11 Container With Most Water Java解答
12 Integer to Roman Java解答
13 Roman to Integer Java解答
14 Longest Common Prefix Java解答
15 3Sum Java解答
16 3Sum Closest Java解答
17 Letter solution.Combinations of a Phone Number Java解答
18 4Sum Java解答
19 Remove Nth Node From End of List Java解答
20 Valid Parentheses Java解答
21 Merge Two Sorted Lists Java解答
22 Generate Parentheses Java解答 这题看两遍
23 Merge k Sorted Lists Java解答
24 Swap Nodes in Pairs Java解答
25 Reverse Nodes in k-Group Java解答
26 Remove Duplicates from Sorted Array Java解答
27 Remove Element Java解答
28 Implement strStr() Java解答
29 Divide Two Integers Java解答
30 Substring with Concatenation of All Words Java解答
31 Next Permutation Java解答
32 Longest Valid Parentheses Java解答
33 Search in Rotated Sorted Array Java解答
34 Search for a Range Java解答
35 Search Insert Position Java解答
36 Valid Sudoku Java解答
37 Sudoku Solver Java解答 这道题是典型的back tracking,多做几遍
38 Count and Say Java解答
39 Combination Sum Java解答 排列组合系列的题要多做几遍
40 Combination Sum II Java解答
41 First Missing Positive Java解答
42 Trapping Rain Water Java解答
43 Multiply Strings Java解答
44 Wildcard Matching Java解答 和#10多做几遍
45 Jump Game II Java解答
46 solution.Permutations Java解答
47 solution.Permutations II Java解答 多做几遍
48 Rotate Image Java解答
49 Group Anagrams Java解答
50 solution.Pow(x, n) Java解答
51 N-Queens Java解答
52 N-Queens II Java解答
53 Maximum Subarray 最大子序和 easy DP算法 DP算法,T=O(N),S=O(1)
54 Spiral Matrix Java解答
55 Jump Game Java解答
56 Merge Intervals Java解答
57 Insert Interval Java解答 这题要多做几遍
60 Permutation Sequence Java解答 这题思路巧妙,多做两遍
61 Rotate List Java解答
66 Plus One Java解答 这题多看一遍
67 Add Binary Java解答
68 Text Justification Java解答
69 solution.Sqrt(x) Java解答
70 Climb Stairs 爬楼梯 easy 迭代法/动态规划法/递归法 可使用迭代法/动态规划法/递归法
71 Simplify Path Java解答
72 Edit Distance Java解答
73 Set Matrix Zeroes Java解答
74 Search a 2D Matrix Java解答
75 Sort Colors Java解答 这题多做几遍,很有意思
76 Minimum Window Substring Java解答 这题以及类似的题一定要多做几遍,很经典,参见window
77 solution.Combinations Java解答
78 solution.Subsets Java解答
79 Word Search Java解答
80 Remove Duplicates from Sorted Array II Java解答
81 Search in Rotated Sorted Array II Java解答
82 Remove Duplicates from Sorted List II Java解答
83 Remove Duplicates from Sorted List Java解答
84 Largest Rectangle in Histogram Java解答
85 Maximal Rectangle Java解答
86 Partition List Java解答
88 Merge Sorted Array Java解答
90 solution.Subsets II Java解答
91 Decode Ways Java解答 这题多做几遍,包括#639
92 Reverse Linked List II Java解答
93 Restore IP Addresses Java解答 多看两遍
94 Binary Tree Inorder Traversal Java解答
95 Unique Binary Search Trees II Java解答 多做几遍,递归和DP
96 Unique Binary Search Trees Java解答
98 Validate Binary Search Tree Java解答 注意溢出
99 Recover Binary Search Tree Java解答 这题很容易错,要多做几遍
100 Same Tree Java解答
101 Symmetric Tree 对称二叉树 Java解答
102 Binary Tree Level Order Traversal Java解答
103 Binary Tree Zigzag Level Order Traversal Java解答
104 Maximum Depth of Binary Tree 最大树深度 Java解答
105 Construct Binary Tree from Preorder and Inorder Traversal Java解答
106 Construct Binary Tree from Inorder and Postorder Traversal Java解答
107 Binary Tree Level Order Traversal II Java解答
108 Convert Sorted Array to Binary Search Tree Java解答
109 Convert Sorted List to Binary Search Tree Java解答
110 Balanced Binary Tree 平衡二叉树 Java解答
111 Minimum Depth of Binary Tree Java解答
112 Path Sum Java解答
113 Path Sum II Java解答 错了好几次,得多做几遍
114 Flatten Binary Tree to Linked List Java解答
116 Populating Next Right Pointers in Each Node Java解答
117 Populating Next Right Pointers in Each Node II Java解答
118 Pascal's Triangle Java解答
119 Pascal's Triangle II Java解答
121 Best Time to Buy and Sell Stock Java解答
122 Best Time to Buy and Sell Stock II Java解答
123 Best Time to Buy and Sell Stock III Java解答
124 Binary Tree Maximum Path Sum Java解答
125 Valid Palindrome Java解答
126 Word Ladder II Java解答
127 Word Ladder Java解答 此题非常经典,务必连同ii多做几遍,将双端BFS吃透
128 Longest Consecutive Sequence Java解答
129 Sum Root to Leaf Numbers Java解答
130 Surrounded Regions Java解答
131 Palindrome Partitioning Java解答
132 Palindrome Partitioning II Java解答
133 Clone Graph Java解答 这题不难,多看两遍,BFS方法再做两遍
135 solution.Candy Java解答
138 Copy List with Random Pointer Java解答 有一个易错点
139 Word Break Java解答 多看两遍
140 Word Break II Java解答 这题多做两遍,很典型
141 Linked List Cycle Java解答
142 Linked List Cycle II Java解答
143 Reorder List Java解答
144 Binary Tree Preorder Traversal Java解答
145 Binary Tree Postorder Traversal Java解答
146 LRU Cache Java解答 好题目,多做几遍
147 Insertion Sort List Java解答
148 Sort List Java解答
149 Max Points on a Line Java解答
150 Evaluate Reverse Polish Notation Java解答
151 Reverse Words in a String Java解答 这题虽然不难,但是也错了几次
152 Maximum Product Subarray Java解答
153 Find Minimum in Rotated Sorted Array Java解答
154 Find Minimum in Rotated Sorted Array II Java解答
155 Min Stack Java解答
156 Binary Tree Upside Down Java解答 这道题挺有意思,多做几遍
157 Read N Characters Given Read4 Java解答 这题多做几遍,结合#158
158 Read N Characters Given Read4 II - Call multiple times Java解答
159 Longest Substring with At Most Two Distinct Characters Java解答 多看两遍
160 Intersection of Two Linked Lists Java解答
161 One Edit Distance Java解答 和#72做两遍
162 Find Peak Element Java解答
163 Missing Ranges Java解答 多做几遍,太容易错了
164 Maximum Gap Java解答
167 Two Sum II - Input array is sorted Java解答
168 Excel Sheet Column Title Java解答
169 Majority Element Java解答
170 Two Sum III - Data structure design Java解答 这道题再多做一遍
171 Excel Sheet Column Number Java解答
172 Factorial Trailing Zeroes Java解答
173 Binary Search Tree Iterator Java解答 多留意一下
179 Largest Number Java解答
186 Reverse Words in a String II Java解答
188 Best Time to Buy and Sell Stock IV Java解答
189 Rotate Array Java解答
190 Reverse Bits Java解答
198 House Robber Java解答
199 Binary Tree Right Side View Java解答
200 Number of Islands Java解答 这道题很经典,而且方法不止一种,每种方法都多做几遍,包括UF,#305
203 Remove Linked List Elements Java解答
204 Count Primes Java解答
206 Reverse Linked List Java解答
207 Course Schedule Java解答 典型的拓扑排序
208 Implement solution.Trie (Prefix Tree) Java解答 和#211多留意,trie很典型
209 Minimum Size Subarray Sum Java解答
210 Course Schedule II Java解答
211 Add and Search Word - Data structure design Java解答
212 Word Search II Java解答
213 House Robber II Java解答
214 Shortest Palindrome Java解答
215 Kth Largest Element in an Array Java解答 这题很经典,三种解法都要了然于胸
216 Combination Sum III Java解答
217 Contains Duplicate Java解答
218 The Skyline Problem Java解答 这题多做两遍
219 Contains Duplicate II Java解答
220 Contains Duplicate III Java解答
221 Maximal Square Java解答
222 Count Complete Tree Nodes Java解答 一般的做法会超时
223 Rectangle Area Java解答
224 Basic Calculator Java解答
225 Implement Stack using Queues Java解答
226 Invert Binary Tree Java解答
228 Summary Ranges Java解答
229 Majority Element II Java解答
230 Kth Smallest Element in a BST Java解答 注意Follow Up
232 Implement Queue using Stacks Java解答
233 Number of Digit One Java解答
234 Palindrome Linked List Java解答
235 Lowest Common Ancestor of a Binary Search Tree Java解答
236 Lowest Common Ancestor of a Binary Tree Java解答 这题很经典,多做几遍,留意节点不在树中的情况
237 Delete Node in a Linked List Java解答
238 Product of Array Except Self Java解答
239 Sliding Window Maximum Java解答 这题非常经典,多做几遍,包括常规算法(优先队列,treemap)及优化算法双端队列
240 Search a 2D Matrix II Java解答
241 Different Ways to Add Parentheses Java解答
242 Valid Anagram Java解答
243 Shortest Word Distance Java解答
244 Shortest Word Distance II Java解答
245 Shortest Word Distance III Java解答
246 Strobogrammatic Number Java解答 #247一个系列,多看两遍
247 Strobogrammatic Number II Java解答 多看两遍
249 Group Shifted Strings Java解答
250 Count Univalue Subtrees Java解答 这题要多做几遍
251 Flatten 2D Vector Java解答
252 Meeting Rooms Java解答
253 Meeting Rooms II Java解答
254 Factor solution.Combinations Java解答
255 Verify Preorder Sequence in Binary Search Tree Java解答 很简单,粗心错了
256 Paint House Java解答
257 Binary Tree Paths Java解答
259 3Sum Smaller Java解答 这题虽然简单,但是因为思维定式还是错了几次
261 Graph Valid Tree Java解答 这题多做几遍
263 Ugly Number Java解答
264 Ugly Number II Java解答
265 Paint House II Java解答
266 Palindrome Permutation Java解答
267 Palindrome Permutation II Java解答 典型,多看两遍
268 Missing Number Java解答
269 Alien Dictionary Java解答 这题要多做几遍
270 Closest Binary Search Tree Value Java解答
271 Encode and Decode Strings Java解答 思路巧妙,多看几遍
272 Closest Binary Search Tree Value II Java解答 这题非常值得多做几遍,几种写法都试试
273 Integer to English Words Java解答 多做几遍,做到bug free
274 H-Index Java解答
275 H-Index II Java解答
277 Find the Celebrity Java解答
278 First Bad Version Java解答
279 Perfect Squares Java解答
280 Wiggle Sort Java解答 思路巧妙,多看两遍
281 Zigzag Iterator Java解答 多做三遍,考虑扩展到k的情况
282 Expression Add Operators Java解答
283 Move Zeroes Java解答
284 Peeking Iterator Java解答
285 Inorder Successor in BST Java解答 这道题有意思,要多做几遍
286 Walls and Gates Java解答 多看两遍
287 Find the Duplicate Number Java解答
288 Unique Word Abbreviation Java解答 这题不难,多做两遍,题目意思容易理解错
289 Game of Life Java解答
293 Flip Game Java解答
294 Flip Game II Java解答
295 Find Median from Data Stream Java解答
297 Serialize and Deserialize Binary Tree Java解答 好题目,多做做,递归的非递归的
298 Binary Tree Longest Consecutive Sequence Java解答 多做三遍,尽可能简洁
299 Bulls and Cows Java解答
300 Longest Increasing Subsequence Java解答
301 Remove Invalid Parentheses Java解答 比较难,多做几遍
302 Smallest Rectangle Enclosing Black Pixels Java解答
303 Range Sum Query - Immutable Java解答
304 Range Sum Query 2D - Immutable Java解答
305 Number of Islands II Java解答 这题多做几遍,经典的UF
307 Range Sum Query - Mutable Java解答 和#303, #304, #308定要多做几遍,掌握BIT
308 Range Sum Query 2D - Mutable Java解答
309 Best Time to Buy and Sell Stock with Cooldown Java解答
310 Minimum Height Trees Java解答 这题多做几遍
311 Sparse Matrix Multiplication Java解答
312 Burst Balloons Java解答
313 Super Ugly Number Java解答
314 Binary Tree Vertical Order Traversal Java解答
315 Count of Smaller Numbers After Self Java解答
316 Remove Duplicate Letters Java解答
317 Shortest Distance from All Buildings Java解答 典型的bfs,多做两遍
319 Bulb Switcher Java解答
320 Generalized Abbreviation Java解答 这题是典型的back tracking,多做几遍
322 Coin Change Java解答
323 Number of Connected Components in an Undirected Graph Java解答 典型的图,多看两遍
324 Wiggle Sort II Java解答
325 Maximum Size Subarray Sum Equals k Java解答 这题思路有意思,多做几遍
328 Odd Even Linked List Java解答
329 Longest Increasing Path in a Matrix Java解答 这题要多做几遍
332 Reconstruct Itinerary Java解答
333 Largest BST Subtree Java解答 这道题虽然不难,但是折腾了很久,一定要多做
334 Increasing Triplet Subsequence Java解答
335 Self Crossing Java解答
336 Palindrome Pairs Java解答
337 House Robber III Java解答 建议再做两遍
339 Nested List Weight Sum Java解答
340 Longest Substring with At Most K Distinct Characters Java解答 和#159类似
341 Flatten Nested List Iterator Java解答 这题有点意思,多做两遍
344 Reverse String Java解答
345 Reverse Vowels of a String Java解答
346 Moving Average from Data Stream Java解答
347 Top K Frequent Elements Java解答
349 Intersection of Two Arrays Java解答
350 Intersection of Two Arrays II Java解答
351 Android Unlock Patterns Java解答 这题多做几遍
357 Count Numbers with Unique Digits Java解答
358 Rearrange String k Distance Apart Java解答
359 Logger Rate Limiter Java解答 这题如果不考虑空间消耗的话其实很简单
361 Bomb Enemy Java解答 这题多做几遍,开始没思路
364 Nested List Weight Sum II Java解答
366 Find Leaves of Binary Tree Java解答 这道题刚开始还没思路
367 Valid Perfect Square Java解答
369 Plus One Linked List Java解答
370 Range Addition Java解答
373 Find K Pairs with Smallest Sums Java解答
374 Guess Number Higher or Lower Java解答
375 Guess Number Higher or Lower II Java解答
377 Combination Sum IV Java解答
378 Kth Smallest Element in a Sorted Matrix Java解答
380 Insert Delete GetRandom O(1) Java解答 这道题很有意思,多做几遍
381 Insert Delete GetRandom O(1) - Duplicates allowed Java解答
382 Linked List Random Node Java解答
384 Shuffle an Array Java解答
387 First Unique Character in a String Java解答
388 Longest Absolute File Path Java解答 其实不难,乍看没思路,多做几遍
391 Perfect Rectangle Java解答 这题很trick,多做两遍
392 Is Subsequence 判断子序列 esay 贪心算法/DP算法 DP算法:不建议使用,纯粹学习思想
393 UTF-8 Validation Java解答 错了很多次,多做几遍
394 Decode String Java解答 这题容易错,多做四遍
395 Longest Substring with At Least K Repeating Characters Java解答
398 Random Pick Index Java解答
399 Evaluate Division Java解答 这题多做几遍
401 Binary Watch Java解答
404 Sum of Left Leaves Java解答
406 Queue Reconstruction by Height Java解答 这题开始没思路,多做几遍
407 Trapping Rain Water II Java解答
408 Valid Word Abbreviation Java解答 多做两遍
409 Longest Palindrome Java解答
410 Split Array Largest Sum Java解答
412 Fizz Buzz Java解答
413 Third Maximum Number Java解答
418 Sentence Screen Fitting Java解答 这题思路巧妙,多做几遍,常规思路超时
422 Valid Word Square Java解答
425 Word Squares Java解答 这题很典型,多做几遍
436 Find Right Interval Java解答
437 Path Sum III Java解答 这道题错了很多遍,要重点关注
438 Find All Anagrams in a String Java解答 这道题非常经典,最优解法需要多做几遍,保证once bug free
442 Find All Duplicates in an Array Java解答
445 Add Two Numbers II Java解答
448 Find All Numbers Disappeared in an Array Java解答
449 Serialize and Deserialize BST Java解答 和#297一样
450 Delete Node in a BST Java解答 这题非常经典,值得多做十遍
451 Sort Characters By Frequency Java解答
455 Assign Cookies 分发饼干 esay 贪心算法
459 Repeated Substring Pattern Java解答
477 Total Hamming Distance Java解答
480 Sliding Window Median Java解答
482 License Key Formatting Java解答
483 Smallest Good Base Java解答
485 Max Consecutive Ones Java解答
487 Max Consecutive Ones II Java解答
501 Find Mode in Binary Search Tree Java解答 不难,容易错,多做两次
508 Most Frequent Subtree Sum Java解答
513 Find Bottom Left Tree Value Java解答
515 Find Largest Value in Each Tree Row Java解答
524 Longest Word in Dictionary through Deleting Java解答
526 Beautiful Arrangement Java解答
535 Encode and Decode TinyURL Java解答
538 Convert BST to Greater Tree Java解答
541 Reverse String II Java解答
543 Diameter of Binary Tree Java解答 这题易错
547 Friend Circles Java解答
557 Reverse Words in a String III Java解答
560 Subarray Sum Equals K Java解答
563 Binary Tree Tilt Java解答
564 Find the Closest Palindrome Java解答 此题暴力法即可
572 Subtree of Another Tree Java解答
606 Construct String from Binary Tree Java解答
617 Merge Two Binary Trees Java解答 很简单
621 Task Scheduler Java解答
637 Average of Levels in Binary Tree Java解答
652 Find Duplicate Subtrees Java解答 开始还没思路
653 Two Sum IV - Input is a BST Java解答
654 Maximum Binary Tree Java解答
669 Trim a Binary Search Tree Java解答
681 Next Closest Time Java解答 这题多做几遍
683 K Empty Slots Java解答
684 Redundant Connection Java解答
687 Longest Univalue Path Java解答
695 Max Area of Island Java解答
703 Kth Largest Element in a Stream 数据流中第K大元素 medium 优先级队列解法 / 小根堆解法 优先级队列解法/小根堆解法
771 Jewels and Stones Java解答
814 Binary Tree Pruning Java解答
819 Most Common Word Java解答
843 Guess the Word Java解答
844 Backspace String Compare Java解答
849 Maximize Distance to Closest Person Java解答
857 Minimum Cost to Hire K Workers Java解答
872 Leaf-Similar Trees Java解答
889 Construct Binary Tree from Preorder and Postorder Traversal Java解答
904 Fruit Into Baskets Java解答
929 Unique Email Addresses Java解答
GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.

简介

每日 Leetcode 展开 收起
GPL-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/Clock966/LeetcodeEveryday.git
git@gitee.com:Clock966/LeetcodeEveryday.git
Clock966
LeetcodeEveryday
LeetcodeEveryday
master

搜索帮助