Is using build-in sorting considered cheating in practice tests?
- by user10326
I am using one of the practice online judges where a practice problem is asked and one submits the answer and gets back if it is accepted or not based on test inputs.
My question is the following:
In one of the practice tests, I needed to sort an array as part of the solution algorithm.
If it matters the problem was: find 2 numbers in an array that add up to a specific target.
As part of my algorithm I sorted the array, but to do that I used Java's quicksort and not implement sorting as part of the same method.
To do that I had to do:
java.util.Arrays.sort(array);
Since I had to use the fully qualified name I am wondering if this is a kind of "cheating". (I mean perhaps an online judge does not expect this)
Is it? In a formal interview (since these tests are practice for interview as I understand) would this be acceptable?