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