It's Log in - Codility. You'd have to sign up though. It's the second exercise among the training tasks.
Type: Posts; User: BroVic
It's Log in - Codility. You'd have to sign up though. It's the second exercise among the training tasks.
Makes sense, though the task was agnostic as to how the input vector was generated. Like I said originally, it was for a coding test and the emphasis was on both code correctness and efficiency.
Thanks again. The reason I created `inRange` is because one of the requirements of the task was to check the bounds of both the length of the array AND the value of each element in the array.
Thanks for your reply. Yes, it actually occurred to me to sort the vector first and check for adjacent equal pairs. However I think the problem requires a traversal of the whole vector because only...
I just did an online coding test and my code was said to be correct but performance is an issue. Could anyone help me improve it?
// C++ 14
// 'solution' checks an uneven-length array...