Help with homework
I tried to find solution and logic in task but I didn't. My task is: Write the program which printout the first temperature which is repeating or if it's not the printout "NO TEMPERATURE IS REPEATING". Input is a array of N element. Elements of array is temperature change. INPUT: FIRST LINE: it's entered number of elements N SECOND LINE: elements of array OUTPUT: The first temperature which is repeating or if it's not the printout "NO TEMPERATURE IS REPEATING". Examples: INPUT: 4 1 1 10 -9 OUTPUT: 12 EXPLANATION: C: +1 +1 +10 –9 | +1 +1 +10 –9 |… | +1 +1 +10 –9 T: 0 +1 +2 +12 +3 | +4 +5 +15 +6 |… |+12 +13 +23 +14 C– change, T – temperature Example 2: INPUT: 3 3 -1 5 OUTPUT: NO TEMPERATURE IS REPEATING EXPLANATION: C: +3 -1 +5 | +3 -1 +5 |… T: 0 +3 +2 +7 | +10 +9 +14 |… Elements of array can be between -10^9 and 10^9 Time limit: 1s