Download results
Showing 0-0 of 0 results
Items per page:
10
25
50
100
#
Exercise Title
Features
Description
Platform
Keywords
1
evaluator
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
stack
,
Integer
,
code writing
2
Recursive Add Digits C++
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
recursion
,
Integer
,
math
,
code writing
3
Recursive Half Left C++
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
recursion
,
Integer
,
math
,
code writing
4
Recursive Is Increasing Vector C++
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
recursion
,
Integer
,
vector
,
code writing
5
Literals Exercise 3
Question
,
multiple choice
,
single answer
Multiple Choice Question
CodeWorkout
literals
,
integers
,
multiple choice
,
single answer
6
Average Speed
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
math
,
variables
,
integerDivision
,
code writing
7
Largest integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
cci
,
array
,
coding problem
8
First Integer Larger Than
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
array
,
cci
,
coding problem
9
Nth Integer Larger Than
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
array
,
cci
,
coding problem
10
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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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
20
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
21
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
22
string_to_integer
C++ BehaviorExample for demonstrating string_to_integer
AnnEx
23
Variable to Integer
Python BehaviorExample for demonstrating Variable to Integer
WebEx
numeric types
24
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
25
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
26
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
27
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
28
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
29
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
30
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
31
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
32
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
33
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
34
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
35
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
36
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
37
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
38
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
39
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
40
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
41
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
42
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
43
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
44
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
45
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
46
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
47
Merging two integer arrays
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
array
,
loops. merge
,
1213
,
cci
,
coding problem
48
Get smallest integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
array
,
cci
,
coding problem
49
Sum all integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
arrays
,
cci
,
coding problem
50
Get position of smallest integer
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
array
,
cci
,
coding problem
51
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
52
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
53
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
54
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
55
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
56
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
57
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
58
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
59
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
60
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
61
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
62
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
63
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
64
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
65
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
66
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
67
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
68
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
69
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
70
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
71
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
72
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
73
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
74
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
75
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
76
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
77
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
78
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
79
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
80
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
81
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
82
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
83
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
84
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
85
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
86
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
87
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
88
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
89
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
90
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
91
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
92
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
93
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
94
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
95
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
96
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
97
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
98
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
99
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
100
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
101
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
102
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
103
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
104
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
105
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
106
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
107
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
108
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
109
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
110
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
111
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
112
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
113
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
114
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
115
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
116
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
117
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
118
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
119
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
120
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
121
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
122
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
123
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
124
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
125
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
126
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
127
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
128
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
129
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
130
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
131
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
132
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
133
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
134
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
135
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
136
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
137
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
138
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
139
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
140
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
141
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
142
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
143
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
144
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
145
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
146
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
147
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
148
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
149
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
150
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
151
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
152
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
153
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
154
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
155
Sum 3 integers in array
Free Coding Problem
,
code writing
Coding Question
CodeWorkout
arrays
,
loops
,
code writing
156
Sum 2 integers
Free Coding Problem
,
coding problem
Coding Question
CodeWorkout
int
,
cci
,
coding problem
157
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
158
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
159
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
160
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
161
The Digit Sum of an Integer
Construct a program that calculates the sum of the digits of an integer.
PCEX
while loop
162
Reversing the Digits of an Integer
Construct a program that reverses the digits of an integer mathematically.
PCEX
while loop
163
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
164
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
165
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
166
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
167
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
168
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
169
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
170
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
171
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
172
Reversing the Digits of an Integer
Construct a program that reverses the digits of an integer mathematically.
PCEX
do-while loop
,
while loop
173
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
174
Processing the Digits of an Integer (Case 3)
Construct a program that reverses the digits of an integer mathematically.
PCEX
while loop
175
Processing the Digits of an Integer (Case 2)
Construct a program that calculates the sum of the digits of an integer.
PCEX
while loop
176
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
177
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
178
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
179
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
180
Count the digits of an integer
Free Coding Problem
Coding Question
CodeWorkout
recursion
,
int
,
cci
181
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
182
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
183
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
184
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
185
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
186
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
187
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
188
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
189
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
190
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
191
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
192
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
193
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
194
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
195
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
196
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
197
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
198
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
199
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
200
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
201
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
202
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
203
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
204
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
205
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
206
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
207
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
208
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
209
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
210
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
211
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
212
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
213
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
214
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
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, 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
217
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
218
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
219
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
220
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
221
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
222
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
223
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
224
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
225
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
226
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
227
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
228
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
229
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
230
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
231
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
232
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
233
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
234
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
235
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
236
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
237
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
238
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
239
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
240
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
241
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
242
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
243
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
244
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
245
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
246
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
247
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
248
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
249
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
250
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
251
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
252
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
253
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
254
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
255
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
256
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
257
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
258
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
259
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
260
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
261
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
262
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
263
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
264
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
265
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
266
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
267
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
268
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
269
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
270
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
271
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
272
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
273
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
274
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
275
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
276
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
277
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
278
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
279
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
280
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
281
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
282
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
283
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
284
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
285
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
286
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
287
The Sign of a Number
Construct a program that determines whether an integer is even or odd.
PCEX
if-else statement
288
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
289
Recursive Factorial
Define a function that returns the factorial of a given positive integer.
jsParsons
functions
,
recursion
,
search
,
search algorithms
,
sorting
,
sorting algorithms
290
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
291
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
292
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
293
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
294
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
295
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
296
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
297
Reorganize the list
Construct a program which partition the original list of integers such that all even numbers come first and all odd...
jsParsons
298
Reorganize the list
Construct a function which partition the original list of integers such that all even numbers come first and all odd...
jsParsons
299
Reorganize the list
Construct a function which partition the list of integers given as a parameter such that all even numbers come first...
jsParsons
300
Reorganize the list
Construct a program which partition the original list of integers such that all even numbers come first and all odd...
jsParsons
301
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
302
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
303
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
304
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
305
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
306
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
307
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
308
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
309
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
310
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
311
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
312
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
313
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
314
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
315
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
316
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
317
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
318
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
319
Calculating power
Construct a function which calculates the power of a number. The function takes two integers as parameters (the base number...
jsParsons
320
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
321
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
322
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
323
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
324
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
325
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
326
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
327
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
328
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
329
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
330
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
331
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
332
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
333
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
334
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
335
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
336
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
337
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
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
,
objects
339
Unit Converter
Construct a program that computes the Celsius equivalent of an input Fahrenheit value using the formula C = (F -...
PCEX
operators
,
variables
340
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
341
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
342
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
343
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
344
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
345
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
346
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
347
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
348
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
349
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
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.