![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
whaleseeker
这个作者很懒,什么都没留下…
展开
-
刷题:简单---原list的平方list
array = [1, 2, 3, 5, 6, 8, 9] Java import java.util.*; class Program { public int[] sortedSquaredArray(int[] array) { int [] newarray = new int[array.length]; for(int i = 0; i < array.length; i++){ int value = array[i]; newarray[i]原创 2021-03-15 11:06:45 · 320 阅读 · 0 评论 -
刷题:简单----求b是否为a的子集(python&java)
a = [5, 1, 22, 25, 6, -1, 8, 10] b = [1, 6, -1, 10] Java 重点: size()//list里元素的个数 get(i)//i处的值 import java.util.*; class Program { public static boolean isValidSubsequence(List<Integer> array, List<Integer> sequence) { int i = 0; int j =原创 2021-03-15 08:56:32 · 323 阅读 · 0 评论 -
刷题:简单----求两数之和(python&&java)
array = [3, 5, -4, 8, 11, 1, -1, 6] targetSum = 10 Java import java.util.*; class Program { public static int[] twoNumberSum(int[] array, int targetSum) { for (int i = 0; i < array.length -1; i++){ int firstNum = array[i]; for (int j = i +原创 2021-03-15 08:50:33 · 68 阅读 · 0 评论