27. Remove Element徒手尝试#2(Done)
来源:互联网 发布:mysql alter修改表数据 编辑:程序博客网 时间:2024/06/08 19:52
Solution
public class Solution { public int removeElement(int[] nums, int val) { if (nums == null && nums.length == 0) { return 0; } int i = 0; for (int j = 0; j < nums.length; j++) { if (nums[j] != val) { nums[i++] = nums[j]; } } return i++; }}
Problem#2
* 考虑更简单的情况
Problem#1
* 没有仔细思考
0 0
- 27. Remove Element徒手尝试#2(Done)
- 20_Valid Parentheses徒手尝试#2(Done)
- 66. Plus One徒手尝试#2(Done)
- 26. Remove Duplicates from Sorted Array徒手尝试#1(Done)
- 21. Merge Two Sorted Lists徒手尝试#2(Done)
- 24. Swap Nodes in Pairs徒手尝试#2(Done)
- 38. Count and Say徒手尝试#2(Done)
- 58. Length of Last Word徒手尝试#2(Done)
- 9_PalindromeNumber徒手尝试#4(Done)
- 14_LongestCommonPrefix徒手尝试#3(Done)
- 28. Implement strStr()徒手尝试#3(Done)
- 36. Valid Sudoku徒手尝试#3(Done)
- 19_Remove Nth Node From End of List徒手尝试#2(Done)
- [LeetCode]27.Remove Element
- LeetCode --- 27. Remove Element
- LeetCode 27.Remove Element
- [Leetcode] 27. Remove Element
- 27.Remove Element
- [NHZXOI2017]【NOIP2016】总结
- TCP server保活(keepalive)的应用
- [BZOJ]1096: [ZJOI2007]仓库建设 斜率优化DP
- 深度学习的发展历程总结
- android studio中怎么删除一个module
- 27. Remove Element徒手尝试#2(Done)
- 关于addslashes()和stripslashes()
- mysql-5.7.12-winx64安装的时候无法启动服务问题
- 保护您的应用,防止黑客攻击[Qt]
- SpringMVC使用拦截器
- Android开发之如何保证Service不被杀掉(broadcast+system/app)
- GetCurrentTime(),GetLocalTime(),GetSystemTime()之间的区别
- [分享]把程序锁定到Win7任务栏,该怎么处理
- iBatis的分页