Download results
Showing 0-0 of 0 results
Items per page:
10
25
50
100
#
Exercise Title
Features
Description
Platform
Keywords
1
Literals Exercise 3
Question
,
multiple choice
,
single answer
Multiple Choice Question
CodeWorkout
literals
,
integers
,
multiple choice
,
single answer
2
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
3
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
4
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
5
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
6
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
7
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
8
Receiving Input Integers Until a Certain Condition is Met (Case 1)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
9
Receiving Input Integers Until a Certain Condition is Met (Case 2)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
10
Receiving Input Integers Until a Certain Condition is Met (Case 3)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
11
Receiving Input Integers Until a Certain Condition is Met (Case 4)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
12
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
13
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
14
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
15
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
16
Given two integers x and y, print their sum, but if it is more than 100 or less than 0, print "out of range".
Code Completion
Given two integers x and y, print their sum, but if it is more than 100 or less than 0,...
CodeCheck
Branches
,
Branches Without Functions
17
Given three integers x, y, z, print the sum of the odd integers.
Code Completion
Given three integers x, y, z, print the sum of the odd integers.
CodeCheck
Branches
,
Branches Without Functions
18
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
19
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
20
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
21
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
22
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
23
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
24
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
25
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
26
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
27
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
28
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
29
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
30
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
31
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
32
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
33
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
34
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
35
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
36
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
37
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
38
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
39
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
40
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
41
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
42
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
43
Given a list of integers and an integer n, remove all elementts > n or < -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
44
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
45
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
46
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
47
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
48
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
49
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
50
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
51
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
52
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
53
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
54
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
55
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
56
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
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
66
Receiving Input Integers Until a Certain Condition is Met
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
67
Receiving Input Integers Until a Certain Condition is Met
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
loops
,
while loop
68
Receiving Input Integers Until a Certain Condition is Met (Case 2)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
69
Receiving Input Integers Until a Certain Condition is Met (Case 3)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
70
Receiving Input Integers Until a Certain Condition is Met (Case 4)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
71
Receiving Input Integers Until a Certain Condition is Met (Case 2)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
72
Receiving Input Integers Until a Certain Condition is Met (Case 3)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
73
Receiving Input Integers Until a Certain Condition is Met (Case 4)
Construct a program that receives an integer from the user, outputs that integer, and stops receiving integers when the user...
PCEX
while loop
74
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
75
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
76
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
77
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
78
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
79
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
80
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
81
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
82
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
83
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
84
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
85
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
86
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
87
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
88
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
89
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
90
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
91
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
92
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
93
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
94
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
95
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
96
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
97
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
98
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
99
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
100
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
101
Given three integers x, y, z, print the sum of the odd integers.
Code Completion
Given three integers x, y, z, print the sum of the odd integers.
CodeCheck
Branches
,
Branches Without Functions
102
Given two integers x and y, print their sum, but if it is more than 100 or less than 0, print "out of range".
Code Completion
Given two integers x and y, print their sum, but if it is more than 100 or less than 0,...
CodeCheck
Branches
,
Branches Without Functions
103
Given an array of integers and an integer n, remove all elementts > n or < -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
104
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
105
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
106
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
107
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
108
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
109
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
110
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
111
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
112
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
113
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
114
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
115
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
116
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
117
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
118
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
119
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
120
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
121
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
122
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
123
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
124
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
125
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
126
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
127
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
128
Sum 3 integers in array
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
arrays
,
loops
,
code writing
129
Sum 2 integers
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
cci
,
coding problem
130
Determining the Smallest of the Three Integers
Construct a program that determines the smallest of the three integer values entered by the user.
PCEX
control flow
,
if-else statement
131
Determining the Largest of the Three Integers
Construct a program that determines the largest of the three integer values entered by the user.
PCEX
control flow
132
Calculating the Average of Input Integers
Construct a program that reads a series of integers from the user, sums them up, and calculates their average. The...
PCEX
while loop
133
Calculating the Average of the Input Integers that are an Even Number
Construct a program that reads a series of integer values from the user, sums up the integers that are an...
PCEX
while loop
134
Checks whether the sum of two integers are equal as the third integer
Construct a function which determines whether one of the paraters is the sum of the two other parameters.
jsParsons
135
Checks whether the sum of two integers are equal as the third integer
Construct a program which determines whether the value of one of variables x, y, and z is the sum of...
jsParsons
136
Given a two-dimensional array of integers, return the average of the four corner elements.
Code Completion
Given a two-dimensional array of integers, return the average of the four corner elements.
CodeCheck
Two-Dimensional Arrays
,
No Loops
137
Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or the average of the two or four middle elements of one or both is even.
Code Completion
Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or...
CodeCheck
Two-Dimensional Arrays
,
No Loops
138
Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border in the given compass direction, or the average of the two middle ones if the border length is even.
Code Completion
Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border...
CodeCheck
Two-Dimensional Arrays
,
No Loops
139
Given a two-dimensional array of integers and a string NW, NW, SW, SE, return the sum of the four elements in the given compass direction.
Code Completion
Given a two-dimensional array of integers and a string NW, NW, SW, SE, return the sum of the four elements...
CodeCheck
Two-Dimensional Arrays
,
No Loops
140
Given a two-dimensional array of integers, row/column indexes r, c, and a string N E S W, return the neighbor in that direction, or 0 if it doesn't exist.
Code Completion
Given a two-dimensional array of integers, row/column indexes r, c, and a string N E S W, return the neighbor...
CodeCheck
Two-Dimensional Arrays
,
No Loops
141
Given a two-dimensional array of integers and row/column indexes r, c, return the number of neighbors (not counting the element itself).
Code Completion
Given a two-dimensional array of integers and row/column indexes r, c, return the number of neighbors (not counting the element...
CodeCheck
Two-Dimensional Arrays
,
No Loops
142
Given a two-dimensional array of integers, return the number of distinct elements.
Code Completion
Given a two-dimensional array of integers, return the number of distinct elements.
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
143
Given a two-dimensional array of integers, remove any adjacent duplicate rows by filling the duplicates with zeroes.
Code Completion
Given a two-dimensional array of integers, remove any adjacent duplicate rows by filling the duplicates with zeroes.
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
144
Given a two-dimensional array of integers, return the index of the first row that is entirely filled with zeroes.
Code Completion
Given a two-dimensional array of integers, return the index of the first row that is entirely filled with zeroes.
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
145
Given a two-dimensional array of integers, return the top left corner of the first subarray of the form <pre>0 0 0 0</pre>
Code Completion
Given a two-dimensional array of integers, return the top left corner of the first subarray of the form
0 0...
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
146
Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as a list of length 2.
Code Completion
Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as a list...
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
147
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
148
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N E S W.
Code Completion
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
149
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N E S W NE NW SE SW.
Code Completion
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
150
Given a two-dimensional array of integers and row/column positions r, c, return the compass direction of the largest neighbor as a string N E S W NE NW SE SW.
Code Completion
Given a two-dimensional array of integers and row/column positions r, c, return the compass direction of the largest neighbor as...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
151
Given a two-dimensional array of integers, row/column positions r, c, and a value x, fill the given element and its neighbors in the compass directions N E S W NE NW SE SW with x.
Code Completion
Given a two-dimensional array of integers, row/column positions r, c, and a value x, fill the given element and its...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
152
Given a two-dimensional array a of integers and row/column positions r, c, return a 3x3 array whose middle element is a[r][c], and whose neighbors are copied from the original.
Code Completion
Given a two-dimensional array a of integers and row/column positions r, c, return a 3x3 array whose middle element is...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
153
Given a two-dimensional array of integers, compute the sum of all positive elements.
Code Completion
Given a two-dimensional array of integers, compute the sum of all positive elements.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
154
Given a two-dimensional array of integers, return the largest element in the array.
Code Completion
Given a two-dimensional array of integers, return the largest element in the array.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
155
Given a two-dimensional array of integers, return the position of the smallest element in the array as a list of length 2.
Code Completion
Given a two-dimensional array of integers, return the position of the smallest element in the array as a list of...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
156
Given a two-dimensional array of integers and a value x, return the position of the first match as a list of length 2.
Code Completion
Given a two-dimensional array of integers and a value x, return the position of the first match as a list...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
157
Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as a list of arrays of length 2.
Code Completion
Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as a list...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
158
Given a two-dimensional array of integers, compute the sum of all elements that are not one of the borders.
Code Completion
Given a two-dimensional array of integers, compute the sum of all elements that are not one of the borders.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
159
Given a two-dimensional square array of integers, compute the sum of all elements that are not on one of the diagonals.
Code Completion
Given a two-dimensional square array of integers, compute the sum of all elements that are not on one of the...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
160
Given a two-dimensional array of integers, replace all negative elements with zero.
Code Completion
Given a two-dimensional array of integers, replace all negative elements with zero.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
161
Given a two-dimensional array of integers, reverse all rows.
Code Completion
Given a two-dimensional array of integers, reverse all rows.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
162
Given a two-dimensional array of integers, shift each row by one to the right and put a 0 at the leftmost column.
Code Completion
Given a two-dimensional array of integers, shift each row by one to the right and put a 0 at the...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
163
Given an r x c array of integers, return an (r + 2) x (c + 2) array whose borders are zero and whose interior is the original array.
Code Completion
Given an r x c array of integers, return an (r + 2) x (c + 2) array whose borders...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
164
Given a two-dimensional array of integers, return a list of the largest element in each row.
Code Completion
Given a two-dimensional array of integers, return a list of the largest element in each row.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
165
Given a two-dimensional array of integers, return a list of the number of negative elements in each row.
Code Completion
Given a two-dimensional array of integers, return a list of the number of negative elements in each row.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
166
Given a two-dimensional array of integers and a row index, return the largest element in that row.
Code Completion
Given a two-dimensional array of integers and a row index, return the largest element in that row.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
167
Given a two-dimensional array of integers and a row index r, reverse the given row.
Code Completion
Given a two-dimensional array of integers and a row index r, reverse the given row.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
168
Given a two-dimensional square array of integers, reverse both diagonals.
Code Completion
Given a two-dimensional square array of integers, reverse both diagonals.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
169
Given a two-dimensional array of integers and a column index, return the smallest element in that column.
Code Completion
Given a two-dimensional array of integers and a column index, return the smallest element in that column.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
170
Given a two-dimensional array of integers, an index, and a string R or C, return the sum of the elements in that row or column.
Code Completion
Given a two-dimensional array of integers, an index, and a string R or C, return the sum of the elements...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
171
Given a two-dimensional array of integers, a row index r, and a column index c, return the sum of all elements in the given row and column.
Code Completion
Given a two-dimensional array of integers, a row index r, and a column index c, return the sum of all...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
172
Given a two-dimensional array of integers and a string N, E, S, W, return the sum of all elements of the border in the given compass direction.
Code Completion
Given a two-dimensional array of integers and a string N, E, S, W, return the sum of all elements of...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
173
Given a two-dimensional array of integers, return the sum of all elements along the north and south border.
Code Completion
Given a two-dimensional array of integers, return the sum of all elements along the north and south border.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
174
Given a two-dimensional array of integers, return the sum of all elements along all borders but not the corners.
Code Completion
Given a two-dimensional array of integers, return the sum of all elements along all borders but not the corners.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
175
Given a two-dimensional array of integers, return the sum of all elements along all borders including the corners.
Code Completion
Given a two-dimensional array of integers, return the sum of all elements along all borders including the corners.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
176
Given a two-dimensional square array of integers, return the sum of the elements along both diagonals.
Code Completion
Given a two-dimensional square array of integers, return the sum of the elements along both diagonals. Make sure not to...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
177
Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they do not match, as a list of length 2.
Code Completion
Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they...
CodeCheck
Two-Dimensional Arrays
,
Producing 2D Arrays
178
Summation of the first N integers visualization
Presentation
Slideshow showing how to calculate the closed form for the summation of the first N integers.
OpenDSA
Summation
179
The Min/Max of Three Integers
Construct a program that determines the smallest of the three integer values entered by the user.
PCEX
control flow
,
if-else statement
180
The Min/Max of Three Integers
Construct a program that determines the smallest of the three integer values entered by the user.
PCEX
algorithm analysis
,
control flow
,
if statement
,
if-else statement
,
statistics
181
Determining the Largest of the Three Integers
Construct a program that determines the largest of the three integer values entered by the user.
PCEX
conditionals
,
control flow
,
if-else statement
182
Calculating the Average of the Input Integers that are an Even Number
Construct a program that reads a series of integer values from the user, sums up the integers that are an...
PCEX
while loop
183
The Min/Max of Three Integers
Construct a program that determines the largest of the three integer values entered by the user.
PCEX
if-else statement
184
Given a two-dimensional array of integers and a value x, return the position of the first match as an array of length 2.
Code Completion
Given a two-dimensional array of integers and a value x, return the position of the first match as an array...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
185
Given a two-dimensional array of integers, return an array of the number of negative elements in each column.
Code Completion
Given a two-dimensional array of integers, return an array of the number of negative elements in each column.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
186
Given a two-dimensional array of integers, compute the sum of all positive elements.
Code Completion
Given a two-dimensional array of integers, compute the sum of all positive elements.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
187
Given a two-dimensional array of integers, return the position of the smallest element in the array as an array of length 2.
Code Completion
Given a two-dimensional array of integers, return the position of the smallest element in the array as an array of...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
188
Given a two-dimensional square array of integers, compute the sum of all elements that are not on one of the diagonals.
Code Completion
Given a two-dimensional square array of integers, compute the sum of all elements that are not on one of the...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
189
Given a two-dimensional array of integers, replace all negative elements with zero.
Code Completion
Given a two-dimensional array of integers, replace all negative elements with zero.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
190
Given a two-dimensional array of integers, reverse all rows.
Code Completion
Given a two-dimensional array of integers, reverse all rows.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
191
Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as an array of arrays of length 2.
Code Completion
Given a two-dimensional array of integers and a value x, return the positions of all matching elements, as an array...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
192
Given a two-dimensional array of integers, shift each row by one to the right and put a 0 at the leftmost column.
Code Completion
Given a two-dimensional array of integers, shift each row by one to the right and put a 0 at the...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
193
Given a two-dimensional array of integers, compute the sum of all elements that are not one of the borders.
Code Completion
Given a two-dimensional array of integers, compute the sum of all elements that are not one of the borders.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
194
Given a two-dimensional array of integers, return the largest element in the array.
Code Completion
Given a two-dimensional array of integers, return the largest element in the array.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
195
Given a two-dimensional array of integers, return an array of the largest element in each row.
Code Completion
Given a two-dimensional array of integers, return an array of the largest element in each row.
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
196
Given an r x c array of integers, return an (r + 2) x (c + 2) array whose borders are zero and whose interior is the original array.
Code Completion
Given an r x c array of integers, return an (r + 2) x (c + 2) array whose borders...
CodeCheck
Two-Dimensional Arrays
,
Looping Over the Entire Array
197
Given a two-dimensional array of integers, return the number of distinct elements.
Code Completion
Given a two-dimensional array of integers, return the number of distinct elements.
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
198
Given a two-dimensional array of integers, return the index of the first row that is entirely filled with zeroes.
Code Completion
Given a two-dimensional array of integers, return the index of the first row that is entirely filled with zeroes.
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
199
Given a two-dimensional array of integers, return the index of the first row that is entirely filled with zeroes.
Code Completion
Given a two-dimensional array of integers, return the index of the first row that is entirely filled with zeroes. <
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
200
Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as an array of length 2.
Code Completion
Given a two-dimensional array of integers, return the position of the largest square subarray filled with zeroes, as an array...
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
201
Given a two-dimensional array of integers, remove any adjacent duplicate rows by filling the duplicates with zeroes.
Code Completion
Given a two-dimensional array of integers, remove any adjacent duplicate rows by filling the duplicates with zeroes.
CodeCheck
Two-Dimensional Arrays
,
Complex Loops
202
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N E S W.
Code Completion
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
203
Given a two-dimensional array of integers and row/column positions r, c, return the compass direction of the largest neighbor as a string N E S W NE NW SE SW.
Code Completion
Given a two-dimensional array of integers and row/column positions r, c, return the compass direction of the largest neighbor as...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
204
Given a two-dimensional array of integers, row/column positions r, c, and a value x, fill the given element and its neighbors in the compass directions N E S W NE NW SE SW with x.
Code Completion
Given a two-dimensional array of integers, row/column positions r, c, and a value x, fill the given element and its...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
205
Given a two-dimensional array a of integers and row/column positions r, c, return a 3x3 array whose middle element is a[r][c], and whose neighbors are copied from the original.
Code Completion
Given a two-dimensional array a of integers and row/column positions r, c, return a 3x3 array whose middle element is...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
206
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N E S W NE NW SE SW.
Code Completion
Given a two-dimensional array of integers and row/column positions r, c, return the largest neighbor in the compass directions N...
CodeCheck
Two-Dimensional Arrays
,
Looping over Neighbors
207
Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they do not match, as an array of length 2.
Code Completion
Given two two-dimensional arrays of integers with the same number of rows and columns, return the first position where they...
CodeCheck
Two-Dimensional Arrays
,
Producing 2D Arrays
208
Given a two-dimensional square array of integers, return the sum of the elements along both diagonals.
Code Completion
Given a two-dimensional square array of integers, return the sum of the elements along both diagonals. Make sure not to...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
209
Given a two-dimensional array of integers and a row index, return the largest element in that row.
Code Completion
Given a two-dimensional array of integers and a row index, return the largest element in that row.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
210
Given a two-dimensional square array of integers, reverse both diagonals.
Code Completion
Given a two-dimensional square array of integers, reverse both diagonals.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
211
Given a two-dimensional array of integers, an index, and a string R or C, return the sum of the elements in that row or column.
Code Completion
Given a two-dimensional array of integers, an index, and a string R or C, return the sum of the elements...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
212
Given a two-dimensional array of integers, a row index r, and a column index c, return the sum of all elements in the given row and column.
Code Completion
Given a two-dimensional array of integers, a row index r, and a column index c, return the sum of all...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
213
Given a two-dimensional array of integers and a string N, E, S, W, return the sum of all elements of the border in the given compass direction.
Code Completion
Given a two-dimensional array of integers and a string N, E, S, W, return the sum of all elements of...
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
214
Given a two-dimensional array of integers, return the sum of all elements along the north and south border.
Code Completion
Given a two-dimensional array of integers, return the sum of all elements along the north and south border.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
215
Given a two-dimensional array of integers and a column index, return the smallest element in that column.
Code Completion
Given a two-dimensional array of integers and a column index, return the smallest element in that column.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
216
Given a two-dimensional array of integers and a row index r, reverse the given row.
Code Completion
Given a two-dimensional array of integers and a row index r, reverse the given row.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
217
Given a two-dimensional array of integers, return the sum of all elements along all borders including the corners.
Code Completion
Given a two-dimensional array of integers, return the sum of all elements along all borders including the corners.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
218
Given a two-dimensional array of integers, return the sum of all elements along all borders but not the corners.
Code Completion
Given a two-dimensional array of integers, return the sum of all elements along all borders but not the corners.
CodeCheck
Two-Dimensional Arrays
,
Loops Along a Row or Column
219
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
220
Given a two-dimensional array of integers, return the average of the four corner elements.
Code Completion
Given a two-dimensional array of integers, return the average of the four corner elements.
CodeCheck
Two-Dimensional Arrays
,
No Loops
221
Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border in the given compass direction, or the average of the two middle ones if the border length is even.
Code Completion
Given a two-dimensional array of integers and a string N, E, S, W, give the middle element along the border...
CodeCheck
Two-Dimensional Arrays
,
No Loops
222
Given a two-dimensional array of integers and a string NW, NW, SW, SE, return the sum of the four elements in the given compass direction.
Code Completion
Given a two-dimensional array of integers and a string NW, NW, SW, SE, return the sum of the four elements...
CodeCheck
Two-Dimensional Arrays
,
No Loops
223
Given a two-dimensional array of integers, row/column indexes r, c, and a string N E S W, return the neighbor in that direction, or 0 if it doesn't exist.
Code Completion
Given a two-dimensional array of integers, row/column indexes r, c, and a string N E S W, return the neighbor...
CodeCheck
Two-Dimensional Arrays
,
No Loops
224
Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or the average of the two or four middle elements of one or both is even.
Code Completion
Given a two-dimensional array of integers, return the middle element if both the row and column lenghts are odd, or...
CodeCheck
Two-Dimensional Arrays
,
No Loops
225
Given a two-dimensional array of integers and row/column indexes r, c, return the number of neighbors (not counting the element itself).
Code Completion
Given a two-dimensional array of integers and row/column indexes r, c, return the number of neighbors (not counting the element...
CodeCheck
Two-Dimensional Arrays
,
No Loops
226
Finding Adjacent Consecutive Numbers in a Sequence of Integers
Construct a program that checks whether a sequence of integers, entered one at a time, contains adjacent integers that are...
PCEX
while loop
227
Given two two-dimensional arrays a and b of integers with the same number of rows and columns, return a list of the same size where each element is the greater of the corresponding elements in the two arrays.
Code Completion
Given two two-dimensional arrays a and b of integers with the same number of rows and columns, return a list...
CodeCheck
Two-Dimensional Arrays
,
Producing 2D Arrays
228
Finding Adjacent Consecutive Numbers in a Sequence of Integers
Construct a program that checks whether a sequence of integers, entered one at a time, contains adjacent integers that are...
PCEX
while loop
229
Given two two-dimensional arrays a and b of integers with the same number of rows and columns, return an array of the same size where each element is the greater of the corresponding elements in the two arrays.
Code Completion
Given two two-dimensional arrays a and b of integers with the same number of rows and columns, return an array...
CodeCheck
Two-Dimensional Arrays
,
Producing 2D Arrays
230
Given a string, find the sum of all integers inside.
Code Completion
Given a string, find the sum of all integers inside. Return 0 if there is no integer inside.
CodeCheck
Strings
,
Numbers in Strings
231
Given a string, find all integers inside and return a string that separates them by commas.
Code Completion
Given a string, find all integers inside and return a string that separates them by commas.
CodeCheck
Strings
,
Numbers in Strings
232
Given a string, find all integers inside and return a string that separates them by commas.
Code Completion
Given a string, find all integers inside and return a string that separates them by commas.
CodeCheck
Strings
,
Numbers in Strings
233
Given a string, find the sum of all integers inside.
Code Completion
Given a string, find the sum of all integers inside. Return 0 if there is no integer inside.
CodeCheck
Strings
,
Numbers in Strings
234
Updating an Element in the Array (Case 1)
Construct a program that initializes an array with three integers, changes the first element in the array, and finally, prints...
PCEX
arrays
235
Printing the Squares of Numbers Within a Specified Range (Case 1)
Construct a program to write out the squares of even positive integers less than or equal to 10.
PCEX
for loop
236
Printing the Squares of Numbers Within a Specified Range (Case 2)
Construct a program to write out the squares of odd positive integers less than 10.
PCEX
for loop
237
Construct a program with multiple if-elif statements
Construct a program which checks whether each of the integers in interval from 1 to 100 is divisible by 2,...
jsParsons
238
Construct a program with multiple if-elif statements
Construct a program which checks which of the integers in interval from 1 to 50 is divisible by only 2,...
jsParsons
239
Construct a program with multiple if-elif statements
Construct a program which checks whether each of the integers in interval from 1 to 100 is divisible by 2,...
jsParsons
for loop
240
Reorganize the list
Construct a program which partition the original list of integers such that all even numbers come first and all odd...
jsParsons
241
Reorganize the list
Construct a function which partition the original list of integers such that all even numbers come first and all odd...
jsParsons
242
Reorganize the list
Construct a function which partition the list of integers given as a parameter such that all even numbers come first...
jsParsons
243
Reorganize the list
Construct a program which partition the original list of integers such that all even numbers come first and all odd...
jsParsons
244
Updating an Element in the Array
Construct a program that initializes an array with three integers, changes the first element in the array, and finally, prints...
PCEX
arrays
245
Printing the Squares of Numbers Within a Specified Range
Construct a program to write out the squares of even positive integers less than or equal to 10.
PCEX
for loop
246
Calculating the Average of the Input Numbers
Construct a program that reads a series of integers from the user, sums them up, and calculates their average. The...
PCEX
while loop
247
Calculating the Average of the Input Numbers
Construct a program that reads a series of integers from the user, sums them up, and calculates their average. The...
PCEX
loops
,
while loop
248
Printing the Squares of Numbers Within a Specified Range
Construct a program to write out the squares of even positive integers less than or equal to 10.
PCEX
for loop
,
loops
249
Printing the Squares of Numbers Within a Specified Range (Case 2)
Construct a program to write out the squares of odd positive integers less than 10.
PCEX
for loop
250
Comparing Adjacent Numbers in a Sequence of Numbers (Case 2)
Construct a program that checks whether a sequence of integers, entered one at a time, contains adjacent integers that are...
PCEX
while loop
251
Printing the Squares of Numbers Within a Specified Range (Case 2)
Construct a program to write out the squares of odd positive integers less than 10.
PCEX
for loop
252
Greatest Common Factor
Construct a program that recursively finds and returns the great common factor between of two integers.
PCEX
recursion
,
search
,
search algorithms
,
sorting
,
sorting algorithms
253
Greatest Common Factor Challenge
Construct a program that recursively finds and returns the great common factor between of two integers. This is a simple...
PCEX
recursion
254
Number of even and odd elements
Code Completion
Count the number of even and odd elements in an array of integers. Since you must return two counts, place...
CodeCheck
Arrays and Array Lists
255
Swap adjacent elements in array
Code Completion
Your task is to complete a method that swaps adjacent values in an array of integers. For example, if the...
CodeCheck
Arrays and Array Lists
256
Calculating power
Construct a function which calculates the power of a number. The function takes two integers as parameters (the base number...
jsParsons
257
Calculating the Average of the Input Numbers (Case2)
Construct a program that reads a series of integer values from the user, sums up the integers that are an...
PCEX
while loop
258
Swap first and second half of array
Code Completion
Your task is to complete a method that swaps the first and second half of an array of integers. For...
CodeCheck
Arrays and Array Lists
259
Switch (Memphis)
Demonstrates how to use Java switch statement. This program determines whether an integer between 1 and 10 is prime. (Prime...
AnnEx
switch statement
260
Recursive Binary Search
Construct a function that uses recursive binary search to find if a specific value is in a list (known as...
PCEX
recursion
,
search
,
search algorithms
,
sorting
261
Recursive Binary Search Challenge
Construct a function that uses recursive binary search to find if a specific value is in a list (known as...
PCEX
recursion
,
search algorithms
262
On a chessboard, positions are marked with a letter between a and h for the column and a number between 1 and 8 for the row.
Code Completion
On a chessboard, positions are marked with a letter between a and h for the column and a number between...
CodeCheck
Two-Dimensional Arrays
,
No Loops
263
On a chessboard, positions are marked with a letter between a and h for the column and a number between 1 and 8 for the row.
Code Completion
On a chessboard, positions are marked with a letter between a and h for the column and a number between...
CodeCheck
Two-Dimensional Arrays
,
No Loops
264
Calculating and Rounding Up Body Mass Index (BMI) To the Nearest Integer
BMI is a measure of body fat based on height and weight that applies to adult men and women. BMI...
PCEX
arithmetic operations
265
Calculating and Rounding Up Body Mass Index (BMI) To the Nearest Integer
BMI is a measure of body fat based on height and weight that applies to adult men and women. BMI...
PCEX
arithmetic operations
,
arithmetic operators
,
data types
,
operators
,
variables
266
BMI Calculator
BMI is a measure of body fat based on height and weight that applies to adult men and women. BMI...
PCEX
operators
,
variables
267
evaluator
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
stack
,
Integer
,
code writing
268
Recursive Add Digits C++
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
recursion
,
Integer
,
math
,
code writing
269
Recursive Half Left C++
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
recursion
,
Integer
,
math
,
code writing
270
Recursive Is Increasing Vector C++
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
recursion
,
Integer
,
vector
,
code writing
271
Average Speed
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
math
,
variables
,
integerDivision
,
code writing
272
Largest integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
cci
,
array
,
coding problem
273
First Integer Larger Than
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
array
,
cci
,
coding problem
274
Nth Integer Larger Than
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
array
,
cci
,
coding problem
275
Determining Whether an Integer is Even or Odd
Construct a program that determines whether an integer is even or odd.
PCEX
control flow
,
if-else statement
276
Printing Digits of an Integer from Right to Left
Construct a program that prints the digits of an integer from right to left.
PCEX
while loop
277
string_to_integer
C++ BehaviorExample for demonstrating string_to_integer
AnnEx
278
Variable to Integer
Python BehaviorExample for demonstrating Variable to Integer
WebEx
numeric types
279
Given a point with integer coordinates (x, y) and a compass direction N, E, S, W, print the neigboring lattice point.
Code Completion
Given a point with integer coordinates (x, y) and a compass direction N, E, S, W, print the neigboring lattice...
CodeCheck
Branches
,
Branches Without Functions
280
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
281
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
282
Given an integer n, produce the array <pre>0 1 2 3 .
Code Completion
Given an integer n, produce the array
0 1 2 3 ... n 1 2 3 4 ... 0 ......
CodeCheck
Two-Dimensional Arrays
,
Producing 2D Arrays
283
Determining Whether an Integer is Even or Odd
Construct a program that determines whether an integer is even or odd.
PCEX
control flow
,
if-else statement
284
Reverse an integer
Code Completion
We want to implement a method that reverses the digits in an integer. For example, reverseInt(3456) should yield 6543.
CodeCheck
Recursion
285
Reverse an integer with helper method
Code Completion
We want to implement a method that reverses the digits in an integer. For example, reverseDigits(3456) should yield 6543.
CodeCheck
Recursion
286
Given an integer n, produce the array <pre>0 1 2 3 .
Code Completion
Given an integer n, produce the array
0 1 2 3 ... n 1 2 3 4 ... 0 ......
CodeCheck
Two-Dimensional Arrays
,
Producing 2D Arrays
287
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
288
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
289
Given a point with integer coordinates (x, y) and a compass direction N, E, S, W, print the neigboring lattice point.
Code Completion
Given a point with integer coordinates (x, y) and a compass direction N, E, S, W, print the neigboring lattice...
CodeCheck
Branches
,
Branches Without Functions
290
Merging two integer arrays
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
array
,
loops. merge
,
1213
,
cci
,
coding problem
291
Get smallest integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
array
,
cci
,
coding problem
292
Sum all integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
arrays
,
cci
,
coding problem
293
Get position of smallest integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
array
,
cci
,
coding problem
294
Determining the Sign of an Integer
Construct a program that determines whether an integer is positive, negative, or zero.
PCEX
control flow
,
if-else statement
295
The Digit Sum of an Integer
Construct a program that calculates the sum of the digits of an integer.
PCEX
while loop
296
Reversing the Digits of an Integer
Construct a program that reverses the digits of an integer mathematically.
PCEX
while loop
297
Given a string s and an integer n, return a string in which each of the characters in s is repeated n times.
Code Completion
Given a string s and an integer n, return a string in which each of the characters in s is...
CodeCheck
Strings
,
Other String Operations
298
Processing the Digits of an Integer
Construct a program that prints the digits of an integer from right to left.
PCEX
do-while loop
,
while loop
299
Processing the Digits of an Integer
Construct a program that prints the digits of an integer from right to left.
PCEX
algorithm analysis
,
loops
,
while loop
300
Reversing the Digits of an Integer
Construct a program that reverses the digits of an integer mathematically.
PCEX
do-while loop
,
while loop
301
The Digit Sum of an Integer
Construct a program that calculates the sum of the digits of an integer.
PCEX
do-while loop
,
while loop
302
Processing the Digits of an Integer (Case 3)
Construct a program that reverses the digits of an integer mathematically.
PCEX
while loop
303
Processing the Digits of an Integer (Case 2)
Construct a program that calculates the sum of the digits of an integer.
PCEX
while loop
304
Generic matrix class as a map with integer keys
Code Completion
Your task is to complete the implementation of a generic Matrix class. A matrix is a two-dimensional arrangement of elements....
CodeCheck
Generic Types
305
Generic matrix class as a map with integer pair keys
Code Completion
Your task is to complete the implementation of a generic Matrix class. A matrix is a two-dimensional arrangement of elements....
CodeCheck
Generic Types
306
Given a string s and an integer n, return a string in which each of the characters in s is repeated n times.
Code Completion
Given a string s and an integer n, return a string in which each of the characters in s is...
CodeCheck
Strings
,
Other String Operations
307
Count the digits of an integer
Free Coding Problem
Coding Question
CodeWorkout
recursion
,
int
,
cci
308
Given a string, find the first integer inside and return its value as an integer.
Code Completion
Given a string, find the first integer inside and return its value as an integer. Return 0 if there is...
CodeCheck
Strings
,
Numbers in Strings
309
Given a string, find the first integer inside and return its value as an integer.
Code Completion
Given a string, find the first integer inside and return its value as an integer. Return 0 if there is...
CodeCheck
Strings
,
Numbers in Strings
310
Printing A Sequence of Repeated Numbers (Case 1)
Construct a program that receives an integer N from the user and prints a sequence of space-separated numbers from 1...
PCEX
nested loops
311
Printing A Sequence of Repeated Numbers (Case 2)
Construct a program that receives an integer N from the user and prints a sequence of space-separated numbers from 1...
PCEX
nested loops
312
Passing Values
Construct a function that increases the original integer's value by 1 and return the increased value's memory address.
PCEX
functions
,
value vs reference
313
The Sign of a Number
Construct a program that determines whether an integer is positive, negative, or zero.
PCEX
conditionals
,
control flow
,
if-else statement
314
Printing A Sequence of Repeated Numbers
Construct a program that receives an integer N from the user and prints a sequence of space-separated numbers from 1...
PCEX
nested loops
315
The Sign of a Number
Construct a program that determines whether an integer is positive, negative, or zero.
PCEX
control flow
,
if statement
,
if-else statement
316
Printing A Sequence of Repeated Numbers
Construct a program that receives an integer N from the user and prints a sequence of space-separated numbers from 1...
PCEX
for loop
,
nested loops
317
Printing A Sequence of Repeated Numbers (Case 2)
Construct a program that receives an integer N from the user and prints a sequence of space-separated numbers from 1...
PCEX
for loop
,
nested loops
318
The Sign of a Number
Construct a program that determines whether an integer is even or odd.
PCEX
if-else statement
319
Printing A Sequence of Repeated Numbers
Construct a program that receives an integer N from the user and prints a sequence of space-separated numbers from 1...
PCEX
for loop
,
nested loops
320
Recursive Factorial
Define a function that returns the factorial of a given positive integer.
jsParsons
functions
,
recursion
,
search
,
search algorithms
,
sorting
,
sorting algorithms
321
Static method for computing number of binary digits in n
Code Completion
Supply a static method that computes the number of binary digits in a given integer. For example,
CodeCheck
Designing Classes
322
Input Manipulation Challenge
Construct a program that takes a user's inputs and calculate the division of the inputs.Then convert the division result into...
PCEX
functions
323
A fast priority queue
Code Completion
It is possible to provide a fast priority queue implementation if the inserted items have a bounded number of integer...
CodeCheck
Tree Structures
324
Multiplication as recursive addition
Code Completion
Complete the multiply method in the MyMethods class so that it returns the product of the non-negative integer n multipled...
CodeCheck
Recursion
325
Catching a NumberFormatException
Code Completion
In the following code, catch the NumberFormatException that is thrown when the argument of Integer.parseInt does not represent a number.
CodeCheck
Input and Output
326
Celsius To Fahrenheit Conversion
Construct a program that computes the Fahrenheit equivalent of an input Celsius value using the formula F = (9/5)C +...
PCEX
operators
,
primitive data types
,
variables
327
Fahrenheit to Celsius Conversion
Construct a program that computes the Celsius equivalent of an input Fahrenheit value using the formula C = (F -...
PCEX
primitive data types
328
Point Class Hierarchy (Case 1)
Suppose we have a class Point and we want to extend it to produce class Point3D. The class Point has...
PCEX
inheritance
329
Point Class Hierarchy (Case 2)
Suppose we have a class Point and we want to extend it to produce class Point3D. The class Point has...
PCEX
inheritance
330
The Class for Representing a Point in the Euclidean Plane (Case 1)
Construct a class that represents a point in the Euclidean plane. The class should contain data that represents the point’s...
PCEX
331
The Class for Representing a Point in the Euclidean Plane (Case 2)
Construct a class that represents a point in the Euclidean plane. The class should contain data that represents the point’s...
PCEX
classes
,
objects
332
Practicing using nested while and for loops
Construct a program to print a multiplication chart given the chart_size. Assume that chart_size is set to a positive integer.
jsParsons
algorithm analysis
,
for loop
,
nested loops
333
Nested Loops For 2
Construct a program to print a multiplication chart given the chart_size. Assume that chart_size is set to a positive integer.
jsParsons
nested loops
334
Practicing nested while loops
Construct a program to print an upside-down right triangle. Assume that 'size' is defined, and holds an integer value.
jsParsons
algorithm analysis
,
nested loops
,
while loop
335
Unit Converter
Construct a program that computes the Fahrenheit equivalent of an input Celsius value using the formula F = (9/5)C +...
PCEX
arithmetic operators
,
constants
,
operators
,
primitive data types
,
variables
336
Point Class Hierarchy
Suppose we have a class Point and we want to extend it to produce class Point3D. The class Point has...
PCEX
inheritance
,
object
337
The Class for Representing a Point in the Euclidean Plane
Construct a class that represents a point in the Euclidean plane. The class should contain data that represents the point’s...
PCEX
classes
,
object
,
objects
338
The Class for Representing a Point in the Euclidean Plane
Construct a class that represents a point in the Euclidean plane. The class should contain data that represents the point’s...
PCEX
classes
,
data structures
,
objects
,
stacks
339
Unit Converter
Construct a program that computes the Fahrenheit equivalent of an input Celsius value using the formula F = (9/5)C +...
PCEX
operators
,
variables
340
Fahrenheit to Celsius Conversion
Construct a program that computes the Celsius equivalent of an input Fahrenheit value using the formula C = (F -...
PCEX
arithmetic operators
,
constants
,
data types
,
operators
,
primitive data types
,
variables
341
Point Class Hierarchy (Case 2)
Suppose we have a class Point and we want to extend it to produce class Point3D. The class Point has...
PCEX
constructors
,
inheritance
,
overloading
342
The Class for Representing a Point in the Euclidean Plane (Case 2)
Construct a class that represents a point in the Euclidean plane. The class should contain data that represents the point’s...
PCEX
classes
,
constructors
,
exceptions
,
file i/o
,
inheritance
,
methods
,
objects
,
overloading
343
The Class for Representing a Point in the Euclidean Plane
Construct a class that represents a point in the Euclidean plane. The class should contain data that represents the point’s...
PCEX
classes
,
objects
344
Unit Converter
Construct a program that computes the Celsius equivalent of an input Fahrenheit value using the formula C = (F -...
PCEX
operators
,
variables
345
Counting the Number of Valid and Banned Product Codes (Case 2)
Suppose a hypothetical company uses codes to represent its various products. A product code includes, among other information, a character...
PCEX
exception handling
,
exceptions
346
The Class for Representing a TV (Case 2)
Construct a class that represents a TV. The class should contain data that represents the TV's state (power on or...
PCEX
classes
,
objects
347
Counting the Number of Valid and Banned Product Codes (Case 2)
Suppose a hypothetical company uses codes to represent its various products. A product code includes, among other information, a character...
PCEX
exception handling
,
exceptions
348
The Class for Representing a TV (Case 2)
Construct a class that represents a TV. The class should contain data that represents the TV's state (power on or...
PCEX
classes
,
objects
349
The Class for Representing a TV
Construct a class that represents a TV. The class should contain data that represents the TV's state (power on or...
PCEX
classes
,
objects
350
Counting the Number of Valid and Banned Product Codes
Suppose a hypothetical company uses codes to represent its various products. A product code includes, among other information, a character...
PCEX
exception handling
×
This is a detailed description.