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.
This is my code,
#include 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started