Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

anyone willing to help me get 100%? https://codility.com/demo/results/demoFYPN6X-6TK/

OpenStudy (anonymous):

int solution(vector<int> &A) { unsigned int size = A.size(); for(unsigned int distance = size - 1; distance > 0; distance--) { for(unsigned int index = 0; index < size - distance; index++) { if(A[index] <= A[index + distance]) { return distance; } } } return 0; }

OpenStudy (anonymous):

They want you to do O(n) complexity.

OpenStudy (anonymous):

I've been looking at this problem for a while, and haven't come up with any \(O(n)\) solutions, so it's pretty tough.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!