Skip to content

Tideman - check50 bug #37

Open
Open
@m20s20

Description

@m20s20

I realized that I am able to write code that would give me a wrong output or even cause an overflow.
Changing the code in line 147 to if (n == 0) would potentially skip one of the pairs and not save them which gives two winners as an output when tested on the first example in the instructions while it is only supposed to be one winner.
Changing the code in line 228 to int border = ((last - first) / 2); would have the effect that unsorted arrays with more than 4 elements would cause an overflow because the recursion will not be stopped for the upper half of the array.
Both of these get full credit from check50. I am not sure what exactly is happening in the check50 algorithm which is why I could not look into it any further. They might be more such cases.
tideman.txt

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions