CGX Formatter puzzle discussion

Can’t pass the last test because my code is too slow.
Tried in IDE and it takes 1.4 sec to execute.
Am I the only one looping char by char? :frowning:

Nope, my solution is a finite-state machine too that goes char by char.

Lol solved using String.concat() ! It’s much faster!

1 Like

Did you ever get this validation working, because I’m tearing my hair out on this one.

All my tests cases pass, and all validations except this one (‘Sequences of blocks and strings’) and the ‘All formatting rules’ one - assumedly for the same reason.

It’s pretty much impossible to know what they expect here :confused:

I’m having the same issue, I pass all tests except the “All the formatting rules”. This is pretty frustrating that the IDE test cases do not cover everything and you’re pretty much in the dark. This is not the first time this is happening but this time even the forum doesn’t help :confused:

Could you help me please @CvxFous and @cup_of_tea ?

1 Like

Hi all

My code pass all tests except “Block without spaces not containing a value”

I have tried everything i was able to guess like


and all that stuff is ok

can’t find the issue

1 Like

I had the same issue. Don’t want to giveaway correct test case, but I can give you a clue: “without spaces” doesn’t mean that test case is without spaces, apparently. This is confusing, so I feel good about giving this clue.


Just in case someone needs it
( )
need to return

1 Like

Hi Romuald,
thank you so much for your test input, I managed to find the edge case that got me from 90% to 100%! :slight_smile:

Reposting it as code for future readers, as I had to replace all quotation marks after copying:

 ('un'=1;'deux'='TWO TWO';'trois'=null;'quatre'=true;'cinq'=false;'centvingtdeux'=122)

Help to check case 3 and 5, please :slight_smile:

test case 3 and 5 checked … no problem it works … :wink:

I’m sure everything is right :sweat_smile:.
I would like a tip on the cases 3 and 5 on check.

Help me, please

You mean testcases 3 and 5 or validators 3 and 5 ?
Testcases 3 and 5 are visible if you click on the upper right corner of the testcase area.
You can see the inputs and the expected output.

If you get 100% on testcases but fail on validators 3 and 5, then it will be harder to debug cause validators are not known for official puzzles like this.
So unless an admin gives you insights about those validators, you’ll have to debug it by yourself.
Maybe read the full thread cause it can be interesting, re-read the statement carefully, try all edgecases you can think of with custom testcases (if you set expert mode you can add your own testcases).

1 Like

What does \9 mean on the expected outputs?
Sorry, it actually appeared in my code’s outputs, not the expected outputs. But why did that show up?
Edit 2:
Wait, it also appeared on the expected outputs.

It means horizontal tab, aka “\t”.

For anyone confused about the simple key/value with spaces test #6, my problem was that there was spaces in between the key and the ‘=’.

That was it, thank you @Firefly !
I was getting the 95% because one validator was failing.

Previously I was managing only the spaces around ‘=’. Watch out on this point! :slight_smile:

Can someone please give me an example of Empty string of characters with spaces validator, as it is the only one my code is not passing?
My code works with empty strings (''), deals with spaces inside and/or around strings, with strings consisting in spaces (' ') or when the input is only spaces.

Hello, I also get 95% and can’t pass the ‘Block with spaces containing a value’. Did you already found a sample test case to validate this?