Tasks Details
easy
Find value that occurs in odd number of elements.
Task Score
55%
Correctness
100%
Performance
0%
A non-empty array A consisting of N integers is given. The array contains an odd number of elements, and each element of the array can be paired with another element that has the same value, except for one element that is left unpaired.
For example, in array A such that:
A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5] = 7 A[6] = 9
- the elements at indexes 0 and 2 have value 9,
- the elements at indexes 1 and 3 have value 3,
- the elements at indexes 4 and 6 have value 9,
- the element at index 5 has value 7 and is unpaired.
Write a function:
function solution($A);
that, given an array A consisting of N integers fulfilling the above conditions, returns the value of the unpaired element.
For example, given array A such that:
A[0] = 9 A[1] = 3 A[2] = 9 A[3] = 3 A[4] = 9 A[5] = 7 A[6] = 9the function should return 7, as explained in the example above.
Write an efficient algorithm for the following assumptions:
- N is an odd integer within the range [1..1,000,000];
- each element of array A is an integer within the range [1..1,000,000,000];
- all but one of the values in A occur an even number of times.
Copyright 2009–2024 by Codility Limited. All Rights Reserved. Unauthorized copying, publication or disclosure prohibited.
Solution
Programming language used PHP
Time spent on task 12 minutes
Notes
not defined yet
Task timeline
Code: 16:13:29 UTC,
java,
autosave
Code: 16:14:42 UTC,
php,
autosave
Code: 16:15:05 UTC,
php,
autosave
Code: 16:15:16 UTC,
php,
autosave
Code: 16:16:20 UTC,
php,
autosave
Code: 16:16:31 UTC,
php,
autosave
Code: 16:17:01 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[])
}
}
return $result;
}
Code: 16:17:16 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i]
}
}
}
return $result;
}
Code: 16:17:27 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
return $result;
}
Code: 16:17:37 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
return $result;
}
Code: 16:17:48 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
Code: 16:17:55 UTC,
php,
verify,
result: Failed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
expand all
Example tests
1.
0.032 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 7 in func.php on line 11 Notice: Undefined offset: 7 in func.php on line 11 PHP Notice: Undefined offset: 8 in func.php on line 11 Notice: Undefined offset: 8 in func.php on line 11 PHP Notice: Undefined offset: 9 in func.php on line 11 Notice: Undefined offset: 9 in func.php on line 11 PHP Notice: Undefined offset: 10 in func.php on line 11 Notice: Undefined offset: 10 in func.php on line 11 PHP Notice: Undefined offset: 11 in func.php on line 11 Notice: Undefined offset: 11 in func.php on line 11 PHP Notice: Undefined offset: 12 in func.php on line 11 Notice: Undefined offset: 12 in func.php on line 11 PHP Notice: Undefined offset: 13 in func.php on line 11 Notice: Undefined offset: 13 in func.php on line 11 PHP Notice: Undefined offset: 14 in func.php on line 11 Notice: Undefined offset: 14 in func.php on line 11 PHP Notice: Undefined offset: 15 in func.php on line 11 Notice: Undefined offset: 15 in func.php on line 11 PHP Notice: Undefined offset: 16 in func.php on line 11 Notice: Undefined offset: 16 in func.php on line 11 PHP Notice: Undefined offset: 17 in func.php on line 11 Notice: Undefined offset: 17 in func.php on line 11 PHP Notice: Undefined offset: 18 in func.php on line 11 Notice: Undefined offset: 18 in func.php on line 11 PHP Notice: Undefined offset: 19 in func.php on line 11 Notice: Undefined offset: 19 in func.php on line 11 PHP Notice: Undefined offset: 20 in func.php on line 11 Notice: Undefined offset: 20 in func.php on line 11 PHP Notice: Undefined offset: 21 in func.php on line 11 Notice: Undefined offset: 21 in func.php on line 11 PHP Notice: Undefined offset: 22 in func.php on line 11 Notice: Undefined offset: 22 in func.php on line 11 PHP Notice: Undefined offset: 23 in func.php on line 11 Notice: Undefined offset: 23 in func.php on line 11 PHP Notice: Undefined offset:
expand all
User tests
1.
0.032 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 5 in func.php on line 11 Notice: Undefined offset: 5 in func.php on line 11 PHP Notice: Undefined offset: 6 in func.php on line 11 Notice: Undefined offset: 6 in func.php on line 11 PHP Notice: Undefined offset: 7 in func.php on line 11 Notice: Undefined offset: 7 in func.php on line 11 PHP Notice: Undefined offset: 8 in func.php on line 11 Notice: Undefined offset: 8 in func.php on line 11 PHP Notice: Undefined offset: 9 in func.php on line 11 Notice: Undefined offset: 9 in func.php on line 11 PHP Notice: Undefined offset: 10 in func.php on line 11 Notice: Undefined offset: 10 in func.php on line 11 PHP Notice: Undefined offset: 11 in func.php on line 11 Notice: Undefined offset: 11 in func.php on line 11 PHP Notice: Undefined offset: 12 in func.php on line 11 Notice: Undefined offset: 12 in func.php on line 11 PHP Notice: Undefined offset: 13 in func.php on line 11 Notice: Undefined offset: 13 in func.php on line 11 PHP Notice: Undefined offset: 14 in func.php on line 11 Notice: Undefined offset: 14 in func.php on line 11 PHP Notice: Undefined offset: 15 in func.php on line 11 Notice: Undefined offset: 15 in func.php on line 11 PHP Notice: Undefined offset: 16 in func.php on line 11 Notice: Undefined offset: 16 in func.php on line 11 PHP Notice: Undefined offset: 17 in func.php on line 11 Notice: Undefined offset: 17 in func.php on line 11 PHP Notice: Undefined offset: 18 in func.php on line 11 Notice: Undefined offset: 18 in func.php on line 11 PHP Notice: Undefined offset: 19 in func.php on line 11 Notice: Undefined offset: 19 in func.php on line 11 PHP Notice: Undefined offset: 20 in func.php on line 11 Notice: Undefined offset: 20 in func.php on line 11 PHP Notice: Undefined offset: 21 in func.php on line 11 Notice: Undefined offset: 21 in func.php on line 11 PHP Notice: Undefined offset: 22 i
Code: 16:18:51 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
$
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
Code: 16:19:05 UTC,
php,
verify,
result: Failed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
$size = $N-1;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $size ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
expand all
Example tests
1.
0.032 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 7 in func.php on line 11 Notice: Undefined offset: 7 in func.php on line 11 PHP Notice: Undefined offset: 8 in func.php on line 11 Notice: Undefined offset: 8 in func.php on line 11 PHP Notice: Undefined offset: 9 in func.php on line 11 Notice: Undefined offset: 9 in func.php on line 11 PHP Notice: Undefined offset: 10 in func.php on line 11 Notice: Undefined offset: 10 in func.php on line 11 PHP Notice: Undefined offset: 11 in func.php on line 11 Notice: Undefined offset: 11 in func.php on line 11 PHP Notice: Undefined offset: 12 in func.php on line 11 Notice: Undefined offset: 12 in func.php on line 11 PHP Notice: Undefined offset: 13 in func.php on line 11 Notice: Undefined offset: 13 in func.php on line 11 PHP Notice: Undefined offset: 14 in func.php on line 11 Notice: Undefined offset: 14 in func.php on line 11 PHP Notice: Undefined offset: 15 in func.php on line 11 Notice: Undefined offset: 15 in func.php on line 11 PHP Notice: Undefined offset: 16 in func.php on line 11 Notice: Undefined offset: 16 in func.php on line 11 PHP Notice: Undefined offset: 17 in func.php on line 11 Notice: Undefined offset: 17 in func.php on line 11 PHP Notice: Undefined offset: 18 in func.php on line 11 Notice: Undefined offset: 18 in func.php on line 11 PHP Notice: Undefined offset: 19 in func.php on line 11 Notice: Undefined offset: 19 in func.php on line 11 PHP Notice: Undefined offset: 20 in func.php on line 11 Notice: Undefined offset: 20 in func.php on line 11 PHP Notice: Undefined offset: 21 in func.php on line 11 Notice: Undefined offset: 21 in func.php on line 11 PHP Notice: Undefined offset: 22 in func.php on line 11 Notice: Undefined offset: 22 in func.php on line 11 PHP Notice: Undefined offset: 23 in func.php on line 11 Notice: Undefined offset: 23 in func.php on line 11 PHP Notice: Undefined offset:
expand all
User tests
1.
0.032 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 5 in func.php on line 11 Notice: Undefined offset: 5 in func.php on line 11 PHP Notice: Undefined offset: 6 in func.php on line 11 Notice: Undefined offset: 6 in func.php on line 11 PHP Notice: Undefined offset: 7 in func.php on line 11 Notice: Undefined offset: 7 in func.php on line 11 PHP Notice: Undefined offset: 8 in func.php on line 11 Notice: Undefined offset: 8 in func.php on line 11 PHP Notice: Undefined offset: 9 in func.php on line 11 Notice: Undefined offset: 9 in func.php on line 11 PHP Notice: Undefined offset: 10 in func.php on line 11 Notice: Undefined offset: 10 in func.php on line 11 PHP Notice: Undefined offset: 11 in func.php on line 11 Notice: Undefined offset: 11 in func.php on line 11 PHP Notice: Undefined offset: 12 in func.php on line 11 Notice: Undefined offset: 12 in func.php on line 11 PHP Notice: Undefined offset: 13 in func.php on line 11 Notice: Undefined offset: 13 in func.php on line 11 PHP Notice: Undefined offset: 14 in func.php on line 11 Notice: Undefined offset: 14 in func.php on line 11 PHP Notice: Undefined offset: 15 in func.php on line 11 Notice: Undefined offset: 15 in func.php on line 11 PHP Notice: Undefined offset: 16 in func.php on line 11 Notice: Undefined offset: 16 in func.php on line 11 PHP Notice: Undefined offset: 17 in func.php on line 11 Notice: Undefined offset: 17 in func.php on line 11 PHP Notice: Undefined offset: 18 in func.php on line 11 Notice: Undefined offset: 18 in func.php on line 11 PHP Notice: Undefined offset: 19 in func.php on line 11 Notice: Undefined offset: 19 in func.php on line 11 PHP Notice: Undefined offset: 20 in func.php on line 11 Notice: Undefined offset: 20 in func.php on line 11 PHP Notice: Undefined offset: 21 in func.php on line 11 Notice: Undefined offset: 21 in func.php on line 11 PHP Notice: Undefined offset: 22 i
Code: 16:19:20 UTC,
php,
verify,
result: Failed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
$size = $N-1;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
expand all
Example tests
1.
0.052 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 7 in func.php on line 11 Notice: Undefined offset: 7 in func.php on line 11 PHP Notice: Undefined offset: 8 in func.php on line 11 Notice: Undefined offset: 8 in func.php on line 11 PHP Notice: Undefined offset: 9 in func.php on line 11 Notice: Undefined offset: 9 in func.php on line 11 PHP Notice: Undefined offset: 10 in func.php on line 11 Notice: Undefined offset: 10 in func.php on line 11 PHP Notice: Undefined offset: 11 in func.php on line 11 Notice: Undefined offset: 11 in func.php on line 11 PHP Notice: Undefined offset: 12 in func.php on line 11 Notice: Undefined offset: 12 in func.php on line 11 PHP Notice: Undefined offset: 13 in func.php on line 11 Notice: Undefined offset: 13 in func.php on line 11 PHP Notice: Undefined offset: 14 in func.php on line 11 Notice: Undefined offset: 14 in func.php on line 11 PHP Notice: Undefined offset: 15 in func.php on line 11 Notice: Undefined offset: 15 in func.php on line 11 PHP Notice: Undefined offset: 16 in func.php on line 11 Notice: Undefined offset: 16 in func.php on line 11 PHP Notice: Undefined offset: 17 in func.php on line 11 Notice: Undefined offset: 17 in func.php on line 11 PHP Notice: Undefined offset: 18 in func.php on line 11 Notice: Undefined offset: 18 in func.php on line 11 PHP Notice: Undefined offset: 19 in func.php on line 11 Notice: Undefined offset: 19 in func.php on line 11 PHP Notice: Undefined offset: 20 in func.php on line 11 Notice: Undefined offset: 20 in func.php on line 11 PHP Notice: Undefined offset: 21 in func.php on line 11 Notice: Undefined offset: 21 in func.php on line 11 PHP Notice: Undefined offset: 22 in func.php on line 11 Notice: Undefined offset: 22 in func.php on line 11 PHP Notice: Undefined offset: 23 in func.php on line 11 Notice: Undefined offset: 23 in func.php on line 11 PHP Notice: Undefined offset:
expand all
User tests
1.
0.056 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 5 in func.php on line 11 Notice: Undefined offset: 5 in func.php on line 11 PHP Notice: Undefined offset: 6 in func.php on line 11 Notice: Undefined offset: 6 in func.php on line 11 PHP Notice: Undefined offset: 7 in func.php on line 11 Notice: Undefined offset: 7 in func.php on line 11 PHP Notice: Undefined offset: 8 in func.php on line 11 Notice: Undefined offset: 8 in func.php on line 11 PHP Notice: Undefined offset: 9 in func.php on line 11 Notice: Undefined offset: 9 in func.php on line 11 PHP Notice: Undefined offset: 10 in func.php on line 11 Notice: Undefined offset: 10 in func.php on line 11 PHP Notice: Undefined offset: 11 in func.php on line 11 Notice: Undefined offset: 11 in func.php on line 11 PHP Notice: Undefined offset: 12 in func.php on line 11 Notice: Undefined offset: 12 in func.php on line 11 PHP Notice: Undefined offset: 13 in func.php on line 11 Notice: Undefined offset: 13 in func.php on line 11 PHP Notice: Undefined offset: 14 in func.php on line 11 Notice: Undefined offset: 14 in func.php on line 11 PHP Notice: Undefined offset: 15 in func.php on line 11 Notice: Undefined offset: 15 in func.php on line 11 PHP Notice: Undefined offset: 16 in func.php on line 11 Notice: Undefined offset: 16 in func.php on line 11 PHP Notice: Undefined offset: 17 in func.php on line 11 Notice: Undefined offset: 17 in func.php on line 11 PHP Notice: Undefined offset: 18 in func.php on line 11 Notice: Undefined offset: 18 in func.php on line 11 PHP Notice: Undefined offset: 19 in func.php on line 11 Notice: Undefined offset: 19 in func.php on line 11 PHP Notice: Undefined offset: 20 in func.php on line 11 Notice: Undefined offset: 20 in func.php on line 11 PHP Notice: Undefined offset: 21 in func.php on line 11 Notice: Undefined offset: 21 in func.php on line 11 PHP Notice: Undefined offset: 22 i
Code: 16:19:49 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
$size = $N-1;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N ; $j > $i ; $j++) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
//print_r($A);
return $result;
}
Code: 16:20:18 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
print 'i: '.$i.'/j: '.$j."\n";
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
//print_r($A);
return $result;
}
Code: 16:20:29 UTC,
php,
verify,
result: Failed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j++) {
print "i: ".$i."/j: ".$j."\n";
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
//print_r($A);
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
expand all
Example tests
1.
0.044 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 7 in func.php on line 12 Notice: Undefined offset: 7 in func.php on line 12 PHP Notice: Undefined offset: 8 in func.php on line 12 Notice: Undefined offset: 8 in func.php on line 12 PHP Notice: Undefined offset: 9 in func.php on line 12 Notice: Undefined offset: 9 in func.php on line 12 PHP Notice: Undefined offset: 10 in func.php on line 12 Notice: Undefined offset: 10 in func.php on line 12 PHP Notice: Undefined offset: 11 in func.php on line 12 Notice: Undefined offset: 11 in func.php on line 12 PHP Notice: Undefined offset: 12 in func.php on line 12 Notice: Undefined offset: 12 in func.php on line 12 PHP Notice: Undefined offset: 13 in func.php on line 12 Notice: Undefined offset: 13 in func.php on line 12 PHP Notice: Undefined offset: 14 in func.php on line 12 Notice: Undefined offset: 14 in func.php on line 12 PHP Notice: Undefined offset: 15 in func.php on line 12 Notice: Undefined offset: 15 in func.php on line 12 PHP Notice: Undefined offset: 16 in func.php on line 12 Notice: Undefined offset: 16 in func.php on line 12 PHP Notice: Undefined offset: 17 in func.php on line 12 Notice: Undefined offset: 17 in func.php on line 12 PHP Notice: Undefined offset: 18 in func.php on line 12 Notice: Undefined offset: 18 in func.php on line 12 PHP Notice: Undefined offset: 19 in func.php on line 12 Notice: Undefined offset: 19 in func.php on line 12 PHP Notice: Undefined offset: 20 in func.php on line 12 Notice: Undefined offset: 20 in func.php on line 12 PHP Notice: Undefined offset: 21 in func.php on line 12 Notice: Undefined offset: 21 in func.php on line 12 PHP Notice: Undefined offset: 22 in func.php on line 12 Notice: Undefined offset: 22 in func.php on line 12 PHP Notice: Undefined offset: 23 in func.php on line 12 Notice: Undefined offset: 23 in func.php on line 12 PHP Notice: Undefined offset:stdout:
i: 0/j: 6 i: 0/j: 7 i: 0/j: 8 i: 0/j: 9 i: 0/j: 10 i: 0/j: 11 i: 0/j: 12 i: 0/j: 13 i: 0/j: 14 i: 0/j: 15 i: 0/j: 16 i: 0/j: 17 i: 0/j: 18 i: 0/j: 19 i: 0/j: 20 i: 0/j: 21 i: 0/j: 22 i: 0/j: 23 i: 0/j: 24 i: 0/j: 25 i: 0/j: 26 i: 0/j: 27 i: 0/j: 28 i: 0/j: 29 i: 0/j: 30 i: 0/j: 31 i: 0/j: 32 i: 0/j: 33 i: 0/j: 34 i: 0/j: 35 i: 0/j: 36 i: 0/j: 37 i: 0/j: 38 i: 0/j: 39 i: 0/j: 40 i: 0/j: 41 i: 0/j: 42 i: 0/j: 43 i: 0/j: 44 i: 0/j: 45 i: 0/j: 46 i: 0/j: 47 i: 0/j: 48 i: 0/j: 49 i: 0/j: 50 i: 0/j: 51 i: 0/j: 52 i: 0/j: 53 i: 0/j: 54 i: 0/j: 55 i: 0/j: 56 i: 0/j: 57 i: 0/j: 58 i: 0/j: 59 i: 0/j: 60 i: 0/j: 61 i: 0/j: 62 i: 0/j: 63 i: 0/j: 64 i: 0/j: 65 i: 0/j: 66 i: 0/j: 67 i: 0/j: 68 i: 0/j: 69 i: 0/j: 70 i: 0/j: 71 i: 0/j: 72 i: 0/j: 73 i: 0/j: 74 i: 0/j: 75 i: 0/j: 76 i: 0/j: 77 i: 0/j: 78 i: 0/j: 79 i: 0/j: 80 i: 0/j: 81 i: 0/j: 82 i: 0/j: 83 i: 0/j: 84 i: 0/j: 85 i: 0/j: 86 i: 0/j: 87 i: 0/j: 88 i: 0/j: 89 i: 0/j: 90 i: 0/j: 91 i: 0/j: 92 i: 0/j: 93 i: 0/j: 94 i: 0/j: 95 i: 0/j: 96 i: 0/j: 97 i: 0/j: 98 i: 0/j: 99 i: 0/j: 100 i: 0/j: 101 i: 0/j: 102 i: 0/j: 103 i: 0/j: 104 i: 0/j: 105 i: 0/j: 106 i: 0/j: 107 i: 0/j: 108 i: 0/j: 109 i: 0/j: 110 i: 0/j: 111 i: 0/j: 112 i: 0/j: 113 i: 0/j: 114 i: 0/j: 115 i: 0/j: 116 i: 0/j: 117 i: 0/j: 118 i: 0/j: 119 i: 0/j: 120 i: 0/j: 121 i: 0/j: 122 i: 0/j: 123 i: 0/j: 124 i: 0/j: 125 i: 0/j: 126 i: 0/j: 127 i: 0/j: 128 i: 0/j: 129 i: 0/j: 130 i: 0/j: 131 i: 0/j: 132 i: 0/j: 133 i: 0/j: 134 i: 0/j: 135 i: 0/j: 136 i: 0/j: 137 i: 0/j: 138 i: 0/j: 139 i: 0/j: 140 i: 0/j: 141 i: 0/j: 142 i: 0/j: 143 i: 0/j: 144 i: 0/j: 145 i: 0/j: 146 i: 0/j: 147 i: 0/j: 148 i: 0/j: 149 i: 0/j: 150 i: 0/j: 151 i: 0/j: 152 i: 0/j: 153 i: 0/j: 154 i: 0/j: 155 i: 0/j: 156 i: 0/j: 157 i: 0/j: 158 i: 0/j: 159 i: 0/j: 160 i: 0/j: 161 i: 0/j: 162 i: 0/j: 163 i: 0/j: 164 i: 0/j: 165 i: 0/j: 166 i: 0/j: 167 i: 0/j: 168 i: 0/j: 169 i: 0/j: 170 i: 0/j: 171 i: 0/j: 172 i: 0/j: 173 i: 0/j: 174 i: 0/j: 175 i: 0/j: 176 i: 0/j: 177 i: 0/j: 178 i: 0/j: 179 i: 0/j: 180 i: 0/j: 181 i: 0/j: 182 i: 0/j: 183 i: 0/j: 18
expand all
User tests
1.
0.044 s
RUNTIME ERROR,
tested program terminated with exit code 153
stderr:
PHP Notice: Undefined offset: 5 in func.php on line 12 Notice: Undefined offset: 5 in func.php on line 12 PHP Notice: Undefined offset: 6 in func.php on line 12 Notice: Undefined offset: 6 in func.php on line 12 PHP Notice: Undefined offset: 7 in func.php on line 12 Notice: Undefined offset: 7 in func.php on line 12 PHP Notice: Undefined offset: 8 in func.php on line 12 Notice: Undefined offset: 8 in func.php on line 12 PHP Notice: Undefined offset: 9 in func.php on line 12 Notice: Undefined offset: 9 in func.php on line 12 PHP Notice: Undefined offset: 10 in func.php on line 12 Notice: Undefined offset: 10 in func.php on line 12 PHP Notice: Undefined offset: 11 in func.php on line 12 Notice: Undefined offset: 11 in func.php on line 12 PHP Notice: Undefined offset: 12 in func.php on line 12 Notice: Undefined offset: 12 in func.php on line 12 PHP Notice: Undefined offset: 13 in func.php on line 12 Notice: Undefined offset: 13 in func.php on line 12 PHP Notice: Undefined offset: 14 in func.php on line 12 Notice: Undefined offset: 14 in func.php on line 12 PHP Notice: Undefined offset: 15 in func.php on line 12 Notice: Undefined offset: 15 in func.php on line 12 PHP Notice: Undefined offset: 16 in func.php on line 12 Notice: Undefined offset: 16 in func.php on line 12 PHP Notice: Undefined offset: 17 in func.php on line 12 Notice: Undefined offset: 17 in func.php on line 12 PHP Notice: Undefined offset: 18 in func.php on line 12 Notice: Undefined offset: 18 in func.php on line 12 PHP Notice: Undefined offset: 19 in func.php on line 12 Notice: Undefined offset: 19 in func.php on line 12 PHP Notice: Undefined offset: 20 in func.php on line 12 Notice: Undefined offset: 20 in func.php on line 12 PHP Notice: Undefined offset: 21 in func.php on line 12 Notice: Undefined offset: 21 in func.php on line 12 PHP Notice: Undefined offset: 22 istdout:
i: 0/j: 4 i: 0/j: 5 i: 0/j: 6 i: 0/j: 7 i: 0/j: 8 i: 0/j: 9 i: 0/j: 10 i: 0/j: 11 i: 0/j: 12 i: 0/j: 13 i: 0/j: 14 i: 0/j: 15 i: 0/j: 16 i: 0/j: 17 i: 0/j: 18 i: 0/j: 19 i: 0/j: 20 i: 0/j: 21 i: 0/j: 22 i: 0/j: 23 i: 0/j: 24 i: 0/j: 25 i: 0/j: 26 i: 0/j: 27 i: 0/j: 28 i: 0/j: 29 i: 0/j: 30 i: 0/j: 31 i: 0/j: 32 i: 0/j: 33 i: 0/j: 34 i: 0/j: 35 i: 0/j: 36 i: 0/j: 37 i: 0/j: 38 i: 0/j: 39 i: 0/j: 40 i: 0/j: 41 i: 0/j: 42 i: 0/j: 43 i: 0/j: 44 i: 0/j: 45 i: 0/j: 46 i: 0/j: 47 i: 0/j: 48 i: 0/j: 49 i: 0/j: 50 i: 0/j: 51 i: 0/j: 52 i: 0/j: 53 i: 0/j: 54 i: 0/j: 55 i: 0/j: 56 i: 0/j: 57 i: 0/j: 58 i: 0/j: 59 i: 0/j: 60 i: 0/j: 61 i: 0/j: 62 i: 0/j: 63 i: 0/j: 64 i: 0/j: 65 i: 0/j: 66 i: 0/j: 67 i: 0/j: 68 i: 0/j: 69 i: 0/j: 70 i: 0/j: 71 i: 0/j: 72 i: 0/j: 73 i: 0/j: 74 i: 0/j: 75 i: 0/j: 76 i: 0/j: 77 i: 0/j: 78 i: 0/j: 79 i: 0/j: 80 i: 0/j: 81 i: 0/j: 82 i: 0/j: 83 i: 0/j: 84 i: 0/j: 85 i: 0/j: 86 i: 0/j: 87 i: 0/j: 88 i: 0/j: 89 i: 0/j: 90 i: 0/j: 91 i: 0/j: 92 i: 0/j: 93 i: 0/j: 94 i: 0/j: 95 i: 0/j: 96 i: 0/j: 97 i: 0/j: 98 i: 0/j: 99 i: 0/j: 100 i: 0/j: 101 i: 0/j: 102 i: 0/j: 103 i: 0/j: 104 i: 0/j: 105 i: 0/j: 106 i: 0/j: 107 i: 0/j: 108 i: 0/j: 109 i: 0/j: 110 i: 0/j: 111 i: 0/j: 112 i: 0/j: 113 i: 0/j: 114 i: 0/j: 115 i: 0/j: 116 i: 0/j: 117 i: 0/j: 118 i: 0/j: 119 i: 0/j: 120 i: 0/j: 121 i: 0/j: 122 i: 0/j: 123 i: 0/j: 124 i: 0/j: 125 i: 0/j: 126 i: 0/j: 127 i: 0/j: 128 i: 0/j: 129 i: 0/j: 130 i: 0/j: 131 i: 0/j: 132 i: 0/j: 133 i: 0/j: 134 i: 0/j: 135 i: 0/j: 136 i: 0/j: 137 i: 0/j: 138 i: 0/j: 139 i: 0/j: 140 i: 0/j: 141 i: 0/j: 142 i: 0/j: 143 i: 0/j: 144 i: 0/j: 145 i: 0/j: 146 i: 0/j: 147 i: 0/j: 148 i: 0/j: 149 i: 0/j: 150 i: 0/j: 151 i: 0/j: 152 i: 0/j: 153 i: 0/j: 154 i: 0/j: 155 i: 0/j: 156 i: 0/j: 157 i: 0/j: 158 i: 0/j: 159 i: 0/j: 160 i: 0/j: 161 i: 0/j: 162 i: 0/j: 163 i: 0/j: 164 i: 0/j: 165 i: 0/j: 166 i: 0/j: 167 i: 0/j: 168 i: 0/j: 169 i: 0/j: 170 i: 0/j: 171 i: 0/j: 172 i: 0/j: 173 i: 0/j: 174 i: 0/j: 175 i: 0/j: 176 i: 0/j: 177 i: 0/j: 178 i: 0/j: 179 i: 0/j: 180 i: 0/j: 181 i: 0/j: 182 i:
Code: 16:20:46 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
print "i: ".$i."/j: ".$j."\n";
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
//print_r($A);
return $result;
}
Code: 16:20:51 UTC,
php,
verify,
result: Failed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
print "i: ".$i."/j: ".$j."\n";
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
expand all
Example tests
1.
0.004 s
WRONG ANSWER,
got 0 expected 7
stdout:
i: 0/j: 6 i: 0/j: 5 i: 0/j: 4 i: 0/j: 3 i: 0/j: 2 i: 0/j: 1 i: 1/j: 6 i: 1/j: 5 i: 1/j: 4 i: 1/j: 3 i: 1/j: 2 i: 2/j: 6 i: 2/j: 5 i: 2/j: 4 i: 2/j: 3 i: 3/j: 6 i: 3/j: 5 i: 3/j: 4 i: 4/j: 6 i: 4/j: 5 i: 5/j: 6 Array ( [0] => [1] => [2] => [3] => [4] => [5] => 7 [6] => )
expand all
User tests
1.
0.004 s
OK
function result: 0
function result: 0
stdout:
i: 0/j: 4 i: 0/j: 3 i: 0/j: 2 i: 0/j: 1 i: 1/j: 4 i: 1/j: 3 i: 1/j: 2 i: 2/j: 4 i: 2/j: 3 i: 3/j: 4 Array ( [0] => [1] => [2] => [3] => [4] => 4 )
Code: 16:21:06 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
print_r($A);
return $result;
}
Code: 16:21:16 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
Code: 16:21:44 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
Code: 16:21:54 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
break;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
Analysis
Code: 16:22:37 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
break;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5]
Analysis
Code: 16:22:43 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
/break;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
Code: 16:22:44 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
//break;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5]
Analysis
Code: 16:23:09 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
break;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
Code: 16:23:15 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
break;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5]
Analysis
expand all
User tests
1.
0.008 s
OK
function result: 4
function result: 4
stdout:
Array ( [4] => 4 )
1.
0.008 s
OK
function result: 2
function result: 2
stdout:
Array ( [3] => 2 )
Code: 16:23:22 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
// break;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5]
Analysis
expand all
User tests
1.
0.004 s
OK
function result: 4
function result: 4
stdout:
Array ( [4] => 4 )
1.
0.004 s
OK
function result: 2
function result: 2
stdout:
Array ( [3] => 2 )
Code: 16:23:47 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
// break;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5, 2, 2]
Analysis
expand all
User tests
1.
0.004 s
OK
function result: 4
function result: 4
stdout:
Array ( [4] => 4 )
1.
0.004 s
OK
function result: 2
function result: 2
stdout:
Array ( [5] => 2 )
Code: 16:24:02 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
/ break;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
Code: 16:24:04 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
break;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5, 2, 2]
Analysis
expand all
User tests
1.
0.004 s
OK
function result: 4
function result: 4
stdout:
Array ( [4] => 4 )
1.
0.004 s
OK
function result: 2
function result: 2
stdout:
Array ( [5] => 2 )
Code: 16:24:22 UTC,
php,
autosave
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
Code: 16:24:24 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A); print_r($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5, 2, 2]
Analysis
expand all
User tests
1.
0.008 s
OK
function result: 4
function result: 4
stdout:
Array ( [4] => 4 )
1.
0.008 s
OK
function result: 2
function result: 2
stdout:
Array ( [5] => 2 )
Code: 16:24:38 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5, 2, 2]
Analysis
Code: 16:24:42 UTC,
php,
verify,
result: Passed
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
User test case 1:
[2, 2, 3, 3, 4]
User test case 2:
[2, 3, 3, 2, 5, 2, 5, 2, 2]
Analysis
Code: 16:24:44 UTC,
php,
final,
score: 
55
// you can write to stdout for debugging purposes, e.g.
// print "this is a debug message\n";
function solution($A) {
$result = 0;
$N = sizeof($A);
if ($N > 1000000) return $result;
for ($i = 0 ; $i < $N ; $i++) {
for ($j = $N-1 ; $j > $i ; $j--) {
if ($A[$i] == $A[$j]) {
$A[$i] = null;
$A[$j] = null;
}
}
}
$A = array_filter($A);
if (sizeof($A) == 1) {
foreach($A as $a) $result = $a;
}
return $result;
}
Analysis summary
The following issues have been detected: timeout errors.
Analysis
Detected time complexity:
O(N**2)
expand all
Performance tests
1.
0.148 s
TIMEOUT ERROR,
running time: 0.15 sec., time limit: 0.10 sec.
medium2
medium random test n=100,003
medium random test n=100,003
✘
TIMEOUT ERROR
running time: >6.00 sec., time limit: 0.13 sec.
running time: >6.00 sec., time limit: 0.13 sec.
1.
6.000 s
TIMEOUT ERROR,
running time: >6.00 sec., time limit: 0.13 sec.
big1
big random test n=999,999, multiple repetitions
big random test n=999,999, multiple repetitions
✘
TIMEOUT ERROR
running time: >6.00 sec., time limit: 0.99 sec.
running time: >6.00 sec., time limit: 0.99 sec.
1.
6.000 s
TIMEOUT ERROR,
running time: >6.00 sec., time limit: 0.99 sec.
1.
7.000 s
TIMEOUT ERROR,
running time: >7.00 sec., time limit: 1.14 sec.