【LeetCode】Remove Duplicates from Sorted List &&Climbing Stairs
来源:互联网 发布:修改rdp端口 编辑:程序博客网 时间:2024/06/07 00:31
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } */public class Solution { public ListNode deleteDuplicates(ListNode head){if (head == null)return null;ListNode curNode = head;while (curNode.next != null) {if (curNode.val == curNode.next.val) {curNode.next = curNode.next.next;} elsecurNode = curNode.next;}return head;}}
public class Solution { public int climbStairs(int n) { int[] a=new int[n+1]; a[1]=1; a[0]=1; for(int i=2;i<=n;i++) a[i]=a[i-1]+a[i-2]; return a[n]; }}
0 0
- 【LeetCode】Remove Duplicates from Sorted List &&Climbing Stairs
- [LeetCode]Add Binary&Climbing Stairs&Remove Duplicates from Sorted List
- Remove Duplicates from Sorted List :from LeetCode
- Leetcode - List - Remove Duplicates from Sorted List
- [leetcode][list] Remove Duplicates from Sorted List
- [leetcode][list] Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List
- [Leetcode] Remove Duplicates from Sorted List II
- LeetCode: Remove Duplicates from Sorted List
- LeetCode: Remove Duplicates from Sorted List II
- [Leetcode] Remove Duplicates from Sorted List II
- leetcode 37: Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List II
- [LeetCode] Remove Duplicates from Sorted List
- [leetcode] Remove Duplicates from Sorted List
- OSCACHE
- PAT---换个格式输出整数
- myeclipse关闭html,jsp等页面的可视化编辑器
- 求正整数n所有可能的和式的组合
- 关于windows API SetFilePointer
- 【LeetCode】Remove Duplicates from Sorted List &&Climbing Stairs
- 10 个技巧让你的 RESTful Web 服务更加实用
- linux 启动详解
- C语言全局变量定义方法
- UVA 11256 - Repetitive Multiple(数论)
- 额城市
- LeetCode: Best Time to Buy and Sell Stock I、II、III
- android 图片处理(截取,缩放)
- 编程之美读书笔记2.15 - 子数组之和的最大值(二维)