![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
lintcode
laohixdxm00
这个作者很懒,什么都没留下…
展开
-
lint 463 · Sort Integers
https://www.lintcode.com/problem/463/?_from=cat[]what is bug?[code]public class Solution { /** * @param A: an integer array * @return: nothing */ public void sortIntegers(int[] A) { // write your code here List&l原创 2021-10-12 16:46:44 · 119 阅读 · 0 评论 -
lintcode 53 · Reverse Words in a String
https://www.lintcode.com/problem/53/?_from=cat[]how many bugs?[code]public class Solution { /* * @param s: A string * @return: A string */ public String reverseWords(String s) { // write your code here if(s==null原创 2021-10-12 12:38:38 · 103 阅读 · 0 评论 -
lintcode 13 · Implement strStr()
https://www.lintcode.com/problem/13/?_from=cat[]is code correct?[code]public class Solution { /** * @param source: * @param target: * @return: return the index */ public int strStr(String source, String target) { /原创 2021-10-12 12:32:06 · 97 阅读 · 0 评论 -
lintcode 521 · Remove Duplicate Numbers in Array
https://www.lintcode.com/problem/521/?_from=cat[bug]what is bug?[code]public class Solution { /** * @param nums: an array of integers * @return: the number of unique integers */ public int deduplication(int[] nums) { // w原创 2021-10-12 12:27:06 · 66 阅读 · 0 评论 -
lint 1900
https://www.lintcode.com/problem/1900/description// 1 see number & char pair as a whole// 2 locate number, as number string has left, right bound, two pointer here// 3 use top down thinking style, use but NOT implement isDigit(), toNum()// 4 after原创 2021-10-10 16:53:53 · 48 阅读 · 0 评论 -
lintcode 1116 · Exclusive Time of Functions
https://www.lintcode.com/problem/1116/[brainstorm]1 split log into id, start/end, timestamp2 start log, push into stack3 end log, pop stack topaccumulate time by two entry by minus[question]1 what is wrong for above idea?2 what question should be a原创 2021-09-10 17:53:56 · 105 阅读 · 0 评论 -
lintcode 1872 · Minimum Cost to Connect Sticks
https://www.lintcode.com/problem/1872/description[brainstorm]1 go through two given cases2 see patternsum up smallest and second smallest,repeat the same calculation.3 use listinsert sum into list cost O(n)say n number, then O(n^2), not good.say原创 2021-09-10 16:24:57 · 64 阅读 · 0 评论 -
lintcode 451
https://www.lintcode.com/problem/451/[cost]30 min[brainstorm]1 decouple corner case and general case handling.2 when moving to next two nodes, what case should be considered?3 how to keep head as return value?[desc]1 handle corner cases.2 handle g原创 2021-09-10 14:57:22 · 67 阅读 · 0 评论