# 2. Pattern: two points
5jerry
这个作者很懒,什么都没留下…
展开
-
Squaring a Sorted Array (easy)
刷题顺序:https://blog.csdn.net/IBelieve2016/article/details/104544763 /* 给定一个按非递减顺序排序的整数数组 A,返回每个数字的平方组成的新数组, 要求也按非递减顺序排序。? 示例 1: 输入:[-4,-1,0,3,10] 输出:[0,1,9,16,100] */ #include<iostream> #include<math.h> #include<vector> using namespace .原创 2021-01-07 16:29:47 · 155 阅读 · 0 评论 -
Remove Duplicates (easy)
刷题顺序:https://blog.csdn.net/IBelieve2016/article/details/104544763 /* Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do t.原创 2021-01-07 16:28:47 · 144 阅读 · 0 评论 -
Pair with Target Sum (easy)
刷题参考:https://blog.csdn.net/IBelieve2016/article/details/104544763 #include <iostream> #include<vector> using namespace std; /* 问题描述: 给定一个有序数组和一个目标和,在数组中找到一对和等于给定目标的数组, 有就返回下标,没有就返回[-1,-1]。 例如: s=[1,2,3,4,5,6,7,8],k=14,返回[5,7],也就是下标为5和下标为7的和为原创 2021-01-07 16:26:51 · 347 阅读 · 0 评论