会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
darksied
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
2015年8月20日
LeetCode264:Ugly Number II
摘要: 自己的做法超时了。主要是每次生成一个数据,保存到list中,然后对List重新排序。排序太耗费时间记录下讨论组里的写法public int NthUglyNumber(int n) { int[] ugly = new int[n]; ugly[0] = 1; int i...
阅读全文
posted @ 2015-08-20 10:30 darksied
阅读(144)
评论(0)
推荐(0)
2015年8月19日
LeetCode263:Ugly Number
摘要: public bool IsUgly(int num) { if(num1) { if(num%2==0) { num=num/2; } else if(num%3==0) { num=num/3; } else if(n...
阅读全文
posted @ 2015-08-19 17:50 darksied
阅读(145)
评论(0)
推荐(0)
2015年8月14日
LeetCode112:Path Sum
摘要: 正常写法bool HasPathSum(TreeNode root, int sum) { bool ret=false; if(root==null)return false; if(root.left==null&&root.right==null) return root.val=...
阅读全文
posted @ 2015-08-14 10:01 darksied
阅读(136)
评论(0)
推荐(0)
2015年8月12日
leetcode56:Merge Intervals
摘要: 大都是自定义了Interval的比较方法。突发奇想int [] arr=new int[intervals.Count*2]; for(int i=0;i list=new List(); int s=0;//int e=1; int count=0; for(int i=0;...
阅读全文
posted @ 2015-08-12 12:03 darksied
阅读(169)
评论(0)
推荐(0)
2015年8月7日
LeetCode202:Happy Number 。C#版,在vs2010中通过,leetcode中Wrong Answer
摘要: static List nums = new List(); public static bool IsHappy(int n) { int newint = 0; while (n != 0) { ...
阅读全文
posted @ 2015-08-07 18:21 darksied
阅读(228)
评论(0)
推荐(0)
上一页
1
2
公告