随笔分类 - leetcode
摘要:标题:Single Number II正确率:34%难度:中等Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm sh...
阅读全文
摘要:标题:Same Tree通过率:42%难度简单Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are st...
阅读全文
摘要:标题:Linked List Cycle II通过率30%难度中等看升级版前还是先看下Linked List Cycle I看完第一个版本对于第二个版本会有一定的帮助,先了解环的结构。然后看下面的图片:假设快慢指针交汇处为为分红圈那个,环的起始点为k,那么:1、快指针走的路程是慢指针走的两倍。2、慢...
阅读全文
摘要:标题:Linked List Cycle通过率:36%难度中等Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?拿到题后我以为很简单...
阅读全文
摘要:标题Pow(x, n)通过率26.1%难度中等Implement pow(x,n). 以为只是单纯的求xn,习惯了用java里面的math.pow(x,n),所以我认为传进来的值都是比较正常的,谁知道竟然会传n<0的数。。。。。直接泪奔,然后再尝试。。。发现栈溢出,也就是说单纯的递归或者非递归针对...
阅读全文
摘要:标题:Single Number通过率:46.0%难度: 中等Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should ...
阅读全文
摘要:每天一点leetcode,每天一点经验,我为什么要装逼的写成博客?因为我自己在学习中发现了一个问题!有些事情你虽然能做好!但是你却不能把你要做的事情描述出来,这跟没有做一样,还有一种事情就是你感觉你会了。但是让你写你却写不出来。或者表达不出来,这种事情其实你还没有真的理解,都是片面的。我相信做完一题...
阅读全文

浙公网安备 33010602011771号