Sorry for annoying question but are there any possibility to help me understand what exactly happens in Validator 1 & 12?
Maybe it was too hard day for me or something other - but I can’t find at the moment any reasons why my solution in bash failed on them
P.S. I event checked my solutions with other languages but they are fine
The solutions should be re-calculated. My 27 character Perl solution relied on undocumented behavior of the Unix utility sort which has broken in the recent update. My new shortest solution is 37 characters! Without a recalculation, I suspect it is impossible to match the current solutions.
You can indeed use scanf only once.
If anyone wonders how many chars you can do in C without system, my solution without system is 69 chars.
I don’t know if it can get lower than this.
every tests pass for me, but when I submit, the validator 7 don’t pass… Any possible way to know what’s happening, or what’s wrong?
Got 248 chars using Java
Well, I don’t like, that you just can copy one others solution from the practice section.
Also whitespace should not be counted as characters in code golf imho. i = 1 vs. i=1 should give the same code length.
You can see others solutions only if you have solved the puzzle, and only for the language(s) you have used.
Why spaces should not be counted ? If you can write an instruction without spaces do it.
You can see others solutions only if you have solved the puzzle, and only for the language(s) you have used.
Sure, but you can solve it somehow (overcomplicated or just not short) in practice and then just copy the best solution found from another person to the competition.
Why spaces should not be counted ? If you can write an instruction without spaces do it.
That’s exactly why it should not be counted. If the instruction works either way, the formatting should not affect code length. Every editor tells you to write nice code and then we shall forget everything, even if it does not make a difference.
Code golf is all about making the shortest code, not the most beautiful, neither the most performant. And spaces are just details, the big work is on finding language tricks and “alternative solutions”. Furthermore the shortest solutions are generally not the simplest ones, so the solutions of the practice section are not a big deal here…
In some languages, there are tricks to save characters by properly adjusting spaces.
For example if you want to write in Python: [1+n*n for n in range(10)]
You can save a space like this: [n*n+1for n in range(10)]
So they should be counted.
Hi golfers !
With the recent update of the languages, it could be interesting to recompute scores. Some solutions could be now unreachable (ex: kotlin with minBy).
Also as suggested by OptiPanda some test cases are missing and wrong solutions can pass all validators with less characters.
I know that some of you like to bypass validators but I think not everyone does (ok at least me!). That’s why I like temperature over the others.
But there are still some cases not covered and at least one of my solution is not correct.
Here are the cases that I have noticed that can allow me to gain characters :
1
5526
2
1 0 (order is important)
3
4 0 -8 (0 in the middle and 0 < |4| < |-8| is important)
and a suggestion, the ranking in case of a tie is obviously based on timestamp, it could be interesting like in multi to have this time as a tooltip.