it works, thanks 
Iāve tried that before, but must have messed up somewhere else at the same time
so i cant get 100% on this one because it shows an error in the following validator:
-It works with 5526 alone
can someone explain me what does this mean? thanks.
No. The expected answer is the value of the temperature closer to zero, and not its rank in the array. ā2ā is the correct answer here.
Hi everyone!
Iām writing the code in golang and I also have an issue on this test.
When I submit my code several issues are listed, however, if I test my code on my computer, it seems ok. A few examples:
It works with -273 alone
$ echo "-273" | go run main.go
-273
It works with two negative temperatures that are equal: {-10 -10} ā -10
$ echo "-10 -10" | go run main.go
-10
When two temperatures are as close to 0, then the positive wins: {15 -7 9 14 7 12} ā 7
$ echo "15 -7 9 14 7 12" | go run main.go
7
etc.
Does anyone have an idea what can be wrong?
i have the solution of this puzzle in go and i had no problems with it
Thanks! It was my fault. I didnāt read that the first line was a counter not just another temperature.
So, taking what I thought would be a simple approach, I seem to be having the same issues other folks have with the all negative set, {-273}, {-10, -10} etc.
My approach was to split the string with the temps, copy them to a List<> as integers of absolute value, sort them in ascending order, and then return temp[0]; or ā0ā if no temps are provided. IDE tests work, but still getting 75% in submit.
To test my split and copy, I even provided my extensive list of negative numbers and they parse out just fine.
What gives?
I think you answered your own question.
You only use the absolute values and you have trouble with testcases where the result is negative.
lol, nevermind, I get it. thanks
Hello, I have a little problem and I canāt find it.I write in C,
I pass every test apart from the ā-273 aloneā test, however if I change the input in my code like this:
char temps[256]="-273";
//fgets(temps,256,stdin);
the console output is:
-273
I also tried to input all of the sets of temperatures in the test cases and all were output correctly.
It will be some mistake I havenāt noticed I guess. I donāt know which part of my code I should show, because the output is correct ( so you can find it in the edit). Just that one test fails. I have read all the posts in the forum multiple times ( just the english ones, because I donāt speak French yet).
It fails when there is a final newline like in:
char temps[256]="-273\n";
Some remarks about your code:
Note that you can use ' ', '-', '0' instead of 32, 45, 48. Itās far more readable.
Using temps[i-1] is an error when i == 0.
Anyway, you may consider using strtol() to simplify the extraction of the integer values from the temps string. It may be even simpler to use scanf("%d") to read the values.
Right, I wasnāt counting that the last char is \n. Guess I was just lucky that in the other cases, the closest to zero was not the last temperature.
Oh, sure. My mistake.
Yes, my friend pointed me this out, but I couldnāt find a way to find out what the previous char was. I suppose I should redo all the code differently though.
Yeah, I wasnāt sure if I can touch the original code. It is a simple problem and I was surprised I had so much struggle with it. I have a little knowledge in C syntax yet.
Thank you very much. Iāll look into it.
Hi I use Python, Even I faced similar issues⦠But eventually got through them⦠here is my code
Edit: No Full Code
ā¦but I couldnāt make this :āThe solution displays 0 if no temperatureā
when there is no input, I have error:āIndexError: list index out of rangeā in line: a=abs(int(temps[0]))
plz can you help me with that?
also tell me if I can reduce the length of my code⦠thanks 
The second line is false.
Then, you donāt check if there is data or not.
Same have the same problem, did you solve it?
Bug with the Python 3 code.
Input is not readable as numbers.
A list is given as string instead of integers.
Using the first test case as an example, the expected input of
5
1 -2 -8 4 5
is given as
5
1 - 2 - 8 4 5
Iām relatively new to coding in Java and have no idea how to even start approaching this puzzle. Anyone got any good resources that will help make sense of this
You need to know how to read input from standard-in.
How to split strings and how to convert strings to integers.
And then you need to know how to iterate over an array and do some boolean comparisons with the numbers in the array.
Does this help? Also take a look at the index for the other things I mentioned.
Can you show us the code you use to read the input?
Hello, I believe this puzzle is not working correctly (in Lua at least). I have a correct response according to the lua demo site, tutorialspoint, and codepad but the interpreter here doesnāt want to accept my answer. It says āfound: n expecting: 0ā This is specifically for last ānilā problem. Iāve tried multiple different ways and I cannot seem to get it to work. (And yes I know that the nil is actually a string.) Hereās my code: [NO FULL CODE]