#I want to figure out the HackerRank problem, It is not working

1 messages · Page 1 of 1 (latest)

shadow turtle
#

C code

int* compareTriplets(int a_count, int* a, int b_count, int* b, int* result_count) {
    
    int a_res = 0, b_res = 0, k=0;
    
    if(a_res >= b_res){
        do{
            if(a[k] > b[k])
                a_res++;
            else if(a[k] == b[k])
                continue;
            else 
                b_res++;
        }while(k < a_res);
    }
    else {
        do{
            if(b[k] > a[k])
                b_res++;
            else if(a[k] == b[k])
                continue;
            else 
                a_res++;
        }while(k < b_res);
    }
    
    result_count[0] = a_res;
    result_count[1] = b_res;
    
    return result_count;
}
swift patioBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

swift patioBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.