算法学习_初步
文章平均质量分 52
FacelessFix
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
004判断数组中的重复元素
004判断数组中的重复元素 给定一个整数数组,判断是否存在重复元素。 如果存在一值在数组中出现至少两次,函数返回 true 。如果数组中每个元素都不相同,则返回 false 。 Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. 题目: 解答: 一.数组的方式 1.直接遍历数组 可以原创 2021-03-29 11:08:01 · 2131 阅读 · 0 评论 -
001已排序数组的去重
算法初步 算法练习1 已排序的数组去重 来源:leetcode 给你一个有序数组 nums ,请你 原地 删除重复出现的元素,使每个元素 只出现一次 ,返回删除后数组的新长度。 不要使用额外的数组空间,你必须在 原地 修改输入数组 并在使用 O(1) 额外空间的条件下完成。 Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new原创 2021-03-24 11:30:44 · 131 阅读 · 0 评论
分享