Question: I need help in the C language. It's the only language I know at this point and it's the language that the assignment is in.

I need help in the C language. It's the only language I know at this point and it's the language that the assignment is in. Please do not answer in any other language.

I need help finding out why I'm failing a test case in the following problem. I pass the first 22 of 30 test cases but I fail on the 23rd test case. I have no acces to what the test cases are. All I have to go on are two sample test cases.

I need help in the C language. It's the only language I

This is my code,

#include int main(){ int temp_num; int index = 0; int temp_num_2 = 0; int size; scanf("%d", &size); int outcome[size]; int temp_1[size]; int temp_2[size]; for(int i = 0; i temp_1[k + 1]){ temp_num = temp_1[k]; temp_1[k] = temp_1[k + 1]; temp_1[k + 1] = temp_num; } } } for(int m = 0; m

Yeah, it's not pretty. I take in the size of the array. Then I scanf the array and copy the array because I will later sort the array, but I will also need to know the indices of the orginal array. I then iterate through the sorted array to find any ints that only appear once in the array and save those ints in a new array. Since everything is already in ascending order I know that the highest value unique int is located at temp_2[temp_num_2 - 1]. I then find where that number is in the original array. I add 1 to the index value because (based on the example test case) they index starting at 1 instead of 0.

Could someone please help me?

P.S. I did go back through and indent my code but apparently it won't post indented.

Input The first line of the input contains one integer n, 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!