Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @_yel_p,validated by @JDOnline,@UncleV and @667ekipafond.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @_yel_p,validated by @JDOnline,@UncleV and @667ekipafond.
If you have any issues, feel free to ping them.
Hi,
Maybe thereâs some math trick that helps you solve this directly but isnât this only easy once you have the binary representation of the hexadecimal?
This might be super easy in Python3 but some languages donât handle anything > 2^63 natively.
Hex to binary is easy to do one character at a time, you donât need to convert the whole number at once.
Probably shouldnât be in the easy section though, theres some knowledge needed and a few different steps.
I did it in C++ and I didnât need any big number. As RoboStac said, you can obtain binary representation one character at a time, since the input is hexadecimal.
For information to anyone still searching, it is not needed to solve this problem to track the flips of the digits more precisely than with the use of â#â (I did track each change individually and itâs of no use).
+RoboStac probably shouldnât be in the easy section, there is a clear gap between it and euclidâs algorithm
Hey, still searching. In python. Not that easy for me.
i made a dictionnary and loop throught bit for flip seq and loop for each digit of number but pass test 1,2 and 4 only. Can figure out the issue
Still searching too. Could someone explain the first flips for test 6 : as I understand it, â555689abde1222â becomes â222e8a9##61555â after first flip ( necessarily â1â so vertical flip) and I stop here because there are two â#â. Where do I miss something ?
Thx
â555689abde1222â becomes â222e8a9##61555â after first flip
The statement said, âThe # symbol means arbitrary shapes that donât look like a valid hex digit.â It means it is still a âshapeâ and is allowed to happen as long as it does not happen at the very end.
âbdâ flips to become shapes â##â. Flip again it returns to âbdâ.
Well that changes everything⌠I now have a working code for this, but any test after 10 needs some serious optimisation to run and Iâm not there yet. Iâm wondering as well if this should be in easy or not?
Even in Python, converting to binary is much more expensive than processing character by character.
However, one needs to handle leading (binary) zeroes, which donât count as flips. This seems doubtful to me, especially when there is a test case that starts with an hexa zero, hinting that leading zeroes are meaningful in hexa, but not in binary !
Hi,
In the 6th test, I donât understand why 555689abde1222 can become 55519bd6e8a222, as I canât see any way for a 6 to be a 1.
I handled #, as for instance b becomes # when vertically flipped, I must convert it back to a b when flipped again.
If someone can help me, Iâd be very grateful.
Look at your hands, they are also flipped physically.
I just realized that I forgot to reverse the order while flipping horizontally, my bad.
Thank you for your reply though
Yeah but again you do not need to track it. Think of this puzzle as a whole, meaning that multiple flips (may) lead to the same result as input, hence having the necessary optimisations to do the 10000 flips in the allowed time for the harder test cases.
Thatâs probably because youâre missing a horizontal flip, where the 5551xxx comes from the xxx1222.
Yeah, that was exactly my problem, the puzzle is now solved for me.
Iâve got everything to green except Validator 15 and 22, anything special about these?
I donât see anything special about Validator 15 and Validator 22. If you want, you may send me your code by private message and Iâll see what the issue may be.
In this case, the names âHorizontal flipâ and âVertical flipâ should be swapped, since the axis of symmetry determines the name. In âverticalâ the axis of symmetry is the horizontal line, and in âhorizontalâ it is the vertical line, this confusion with the names, although minor, is confusing.