Showing 0-0 of 0 results
# Exercise Title Features Description Platform Keywords
1 Given an array of integers, return the position of the first occurrence of the largest element. Code Completion Given an array of integers, return the position of the first occurrence of the largest element. CodeCheck Arrays - Simple Exercises, Maximum and Minimum
2 Given an array of integers, return the difference of the positions of the first and the last occurrence of the largest element. Code Completion Given an array of integers, return the difference of the positions of the first and the last occurrence of the... CodeCheck Arrays - Simple Exercises, Maximum and Minimum
3 Given an array of integers, return the difference between the maximum and minimum. Code Completion Given an array of integers, return the difference between the maximum and minimum. CodeCheck Arrays - Simple Exercises, Maximum and Minimum
4 Given an array of integers, swap the the maximum and minimum. Code Completion Given an array of integers, swap the the maximum and minimum. CodeCheck Arrays - Simple Exercises, Maximum and Minimum
5 Given an array of integers, return the second-largest element. Code Completion Given an array of integers, return the second-largest element. CodeCheck Arrays - Simple Exercises, Maximum and Minimum
6 Given an array of integers, return the position of the last occurrence of the largest element. Code Completion Given an array of integers, return the position of the last occurrence of the largest element. CodeCheck Arrays - Simple Exercises, Maximum and Minimum
7 Given an array of element, find the shortest distance between two consecutive elements. Code Completion Given an array of element, find the shortest distance between two consecutive elements. CodeCheck Arrays - Simple Exercises, Maximum and Minimum
8 Given an array of integers of length ≥ 4, return the average of the first two and last two elements. Code Completion Given an array of integers of length ≥ 4, return the average of the first two and last two elements. CodeCheck Arrays - Simple Exercises, No loops
9 Given an array of integers, swap the first and last elements. Code Completion Given an array of integers, swap the first and last elements. CodeCheck Arrays - Simple Exercises, No loops
10 Given an array of integers, swap the first two and the last two elements. Code Completion Given an array of integers, swap the first two and the last two elements. CodeCheck Arrays - Simple Exercises, No loops
11 Given an array of integers of length ≥ 3, return the average of the first, last, and middle element (or the two middle elements if the length is even). Code Completion Given an array of integers of length ≥ 3, return the average of the first, last, and middle element (or... CodeCheck Arrays - Simple Exercises, No loops
12 Given an array of integers, replace each element with the average of its neighbors. Code Completion Given an array of integers, replace each element with the average of its neighbors. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
13 Given an array of integers and an integer n, return an array of the averages of n consecutive elements of the original array. Code Completion Given an array of integers and an integer n, return an array of the averages of n consecutive elements of... CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
14 Given an array of integers, give the largest sum of n consecutive elements. Code Completion Given an array of integers, give the largest sum of n consecutive elements. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
15 Given an array of integers, return the sum of all positive elements. Code Completion Given an array of integers, return the sum of all positive elements. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
16 Given an array of floating-point numbers, return an array of the averages of consecutive element pairs of the original array. Code Completion Given an array of floating-point numbers, return an array of the averages of consecutive element pairs of the original array. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
17 Given an array of integers and two values a and b, return the sum of all elements that are at least a and at most b. Code Completion Given an array of integers and two values a and b, return the sum of all elements that are at... CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
18 Given an array of integers, return the average of all positive elements. Code Completion Given an array of integers, return the average of all positive elements. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
19 Given an array of strings and a string s, return the average length of all strings containing s. Code Completion Given an array of strings and a string s, return the average length of all strings containing s. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
20 Given an array of integers, return the average of all elements that are not the maximum or minimum. Code Completion Given an array of integers, return the average of all elements that are not the maximum or minimum. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
21 Given an array of integers, return the product of all non-zero elements. Code Completion Given an array of integers, return the product of all non-zero elements. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
22 Given an array of integers, return the sum of all odd elements. Code Completion Given an array of integers, return the sum of all odd elements. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
23 Given an array of integers, find the largest sum of two different elements in the array. Code Completion Given an array of integers, find the largest sum of two different elements in the array. CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
24 Given an array of integers, give the largest n ≤ length / 2 so that the sum of the first n elements equals the sum of the last n elements. Code Completion Given an array of integers, give the largest n ≤ length / 2 so that the sum of the first... CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
25 Given an array of integers, give the smallest n so that the sum of the first n elements is at least as large as the sum of the remaining elements. Code Completion Given an array of integers, give the smallest n so that the sum of the first n elements is at... CodeCheck Arrays - Simple Exercises, Sums, Averages, Products
26 Given an array of integers, return an array of length 2 containing the first and last element, in sorted order. Code Completion Given an array of integers, return an array of length 2 containing the first and last element, in sorted order. CodeCheck Arrays - Simple Exercises, Two Answers
27 Given an array of integers, return an array of length 2, with the number of positive and the number of negative elements in the array. Code Completion Given an array of integers, return an array of length 2, with the number of positive and the number of... CodeCheck Arrays - Simple Exercises, Two Answers
28 Given an array of integers, return an array of length 2, each being an array. Code Completion Given an array of integers, return an array of length 2, each being an array. The first one holds the... CodeCheck Arrays - Simple Exercises, Two Answers
29 Given an array of integers, return an array of length 2, each being an array. Code Completion Given an array of integers, return an array of length 2, each being an array. The first one holds the... CodeCheck Arrays - Simple Exercises, Two Answers
30 Given an array of integers, return an array of length 2 containing the minimum and the maximum. Code Completion Given an array of integers, return an array of length 2 containing the minimum and the maximum. CodeCheck Arrays - Simple Exercises, Two Answers
31 Given an integer n, fill an array of length n with 1 -1 1 -1 . Code Completion Given an integer n, fill an array of length n with 1 -1 1 -1 ... CodeCheck Arrays - Simple Exercises, Filling
32 Given integers a and b, fill an array with a, a + 1, a + 2, . Code Completion Given integers a and b, fill an array with a, a + 1, a + 2, ..., b. CodeCheck Arrays - Simple Exercises, Filling
33 Given integers a and b, fill an array containing all even numbers that are at least a and at most b. Code Completion Given integers a and b, fill an array containing all even numbers that are at least a and at most... CodeCheck Arrays - Simple Exercises, Filling
34 Given an integer n, fill an array with 1 2 2 3 3 3 4 4 4 4 . Code Completion Given an integer n, fill an array with 1 2 2 3 3 3 4 4 4 4 ... and... CodeCheck Arrays - Simple Exercises, Filling
35 Given integers n and k, fill an array of length n with 0 1 2 . Code Completion Given integers n and k, fill an array of length n with 0 1 2 ... k-1 0 1 2... CodeCheck Arrays - Simple Exercises, Filling
36 Given an array of integers and an integer n, remove all elementts &gt; n or &lt; -n. Code Completion Given an array of integers and an integer n, remove all elementts > n or < -n. Shift all remaining... CodeCheck Arrays - Simple Exercises, Moving or Removing Elements
37 Given an array of integers, move all zeroes to the front. Code Completion Given an array of integers, move all zeroes to the front. CodeCheck Arrays - Simple Exercises, Moving or Removing Elements
38 Given an array of integers, move all negative numbers to the front and all positive numbers to the back, keeping their relative order. Code Completion Given an array of integers, move all negative numbers to the front and all positive numbers to the back, keeping... CodeCheck Arrays - Simple Exercises, Moving or Removing Elements
39 Given an array of integers, remove all even elements that occur exactly twice. Code Completion Given an array of integers, remove all even elements that occur exactly twice. CodeCheck Arrays - Simple Exercises, Moving or Removing Elements
40 Given an array of integers, remove all adjacent duplicates. Code Completion Given an array of integers, remove all adjacent duplicates. CodeCheck Arrays - Simple Exercises, Moving or Removing Elements
41 Given an array of integers, move all zeroes to the back. Code Completion Given an array of integers, move all zeroes to the back. CodeCheck Arrays - Simple Exercises, Moving or Removing Elements
42 Given an array of integers and a value, return the position of the last occurrence of the value in the array, or -1 if the value does not exist. Code Completion Given an array of integers and a value, return the position of the last occurrence of the value in the... CodeCheck Arrays - Simple Exercises, Finding Elements
43 Given an array of integers and a value, fill an array with all positions of the value in the array. Code Completion Given an array of integers and a value, fill an array with all positions of the value in the array. CodeCheck Arrays - Simple Exercises, Finding Elements
44 Given an array of integers and a value, return the position of the element that is closest to the value. Code Completion Given an array of integers and a value, return the position of the element that is closest to the value.... CodeCheck Arrays - Simple Exercises, Finding Elements
45 Given two arrays of integers of the same length, return the first position where their elements are the same. Code Completion Given two arrays of integers of the same length, return the first position where their elements are the same. CodeCheck Arrays - Simple Exercises, Finding Elements
46 Given two arrays of integers of the same length, return the first position where their elements differ. Code Completion Given two arrays of integers of the same length, return the first position where their elements differ. CodeCheck Arrays - Simple Exercises, Finding Elements
47 Given an array of integers and a value, return the difference between the last and first position of the value in the array, or -1 if the value does not exist. Code Completion Given an array of integers and a value, return the difference between the last and first position of the value... CodeCheck Arrays - Simple Exercises, Finding Elements
48 Given two arrays a and b, remove all elements of b from a. Code Completion Given two arrays a and b, remove all elements of b from a. CodeCheck Arrays - Simple Exercises, Double Loops
49 Given an array a, return the longest n so that the first n elements equal the last n elements. Code Completion Given an array a, return the longest n so that the first n elements equal the last n elements. CodeCheck Arrays - Simple Exercises, Double Loops
50 Given an array of integers, return the largest sum of consecutive elements. Code Completion Given an array of integers, return the largest sum of consecutive elements. CodeCheck Arrays - Simple Exercises, Double Loops
51 Given an array of integers, return the largest sequence whose reverse also occurs somewhere in the array. Code Completion Given an array of integers, return the largest sequence whose reverse also occurs somewhere in the array. CodeCheck Arrays - Simple Exercises, Double Loops
52 Given an array a of integers, return an array of all elements of a that occur exactly once. Code Completion Given an array a of integers, return an array of all elements of a that occur exactly once. CodeCheck Arrays - Simple Exercises, Double Loops
53 Given two arrays a and b, return an array that contains all elements occurring in a but not in b. Code Completion Given two arrays a and b, return an array that contains all elements occurring in a but not in b. CodeCheck Arrays - Simple Exercises, Double Loops
54 Given an array of integers, return the position of the longest subsequence of consecutive integers a, a + 1, a + 2, . Code Completion Given an array of integers, return the position of the longest subsequence of consecutive integers a, a + 1, a... CodeCheck Arrays - Simple Exercises, Double Loops
55 Given an array of integers, return an array of arrays of length 2, containing each unique element together with its frequency. Code Completion Given an array of integers, return an array of arrays of length 2, containing each unique element together with its... CodeCheck Arrays - Simple Exercises, Double Loops
56 Given two arrays of integers a and b of the same length, count the number of positions where the array elements differ by at least 2. Code Completion Given two arrays of integers a and b of the same length, count the number of positions where the array... CodeCheck Arrays - Simple Exercises, Counting Elements
57 Given an array of integers, count how many elements are negative. Code Completion Given an array of integers, count how many elements are negative. CodeCheck Arrays - Simple Exercises, Counting Elements
58 Given an array of integers, return the most frequent element. Code Completion Given an array of integers, return the most frequent element. If there is more than one element with maximum frequency,... CodeCheck Arrays - Simple Exercises, Counting Elements
59 Given an array of integers, return an array of all elements that occur with maximum frequency. Code Completion Given an array of integers, return an array of all elements that occur with maximum frequency. CodeCheck Arrays - Simple Exercises, Counting Elements
60 Given an array of integers, return the position of the first element that occurs more than once, or -1 if all elements occur exactly once. Code Completion Given an array of integers, return the position of the first element that occurs more than once, or -1 if... CodeCheck Arrays - Simple Exercises, Counting Elements
61 Given an array of integers, return an array of all elements that occur exactly once. Code Completion Given an array of integers, return an array of all elements that occur exactly once. CodeCheck Arrays - Simple Exercises, Counting Elements
62 Given an array of integers and two values a and b, count how many elements are at least a and at most b. Code Completion Given an array of integers and two values a and b, count how many elements are at least a and... CodeCheck Arrays - Simple Exercises, Counting Elements
63 Given an array a, count how many times the ith element from the front equals the ith element from the back. Code Completion Given an array a, count how many times the ith element from the front equals the ith element from the... CodeCheck Arrays - Simple Exercises, Counting Elements
64 Given two arrays of integers a and b of the same length, count the number of positions where the arrays have the same elements. Code Completion Given two arrays of integers a and b of the same length, count the number of positions where the arrays... CodeCheck Arrays - Simple Exercises, Counting Elements
65 Given an array of integers, remove all elements that occur more than once, leaving the first occurrence. Code Completion Given an array of integers, remove all elements that occur more than once, leaving the first occurrence. CodeCheck Arrays - Simple Exercises, Counting Elements