[Community Puzzle] Equivalent Resistance, Circuit Building

Or you use fractions.

Maybe that’s not a very related thing, but I had this as the weekly puzzle, I finished it, but it still didn’t count it for me.

Same, does it need time to process or should it report this? Sorry new here and eager for my first Achievement :slight_smile:

@MaxMindz @314Mat related to this:
https://www.codingame.com/forum/t/quest-map-new-home-page-feedbacks-bugs/185603/66

Hi

I wouldn’t consider this puzzle to an easy one neither, It given me headache ^^

I didn’t success to reach 100%, I had 83%, the last Validator didn’t pass. Could I know what’s his composition and the result wanted, so I could try correct my code.

Thanks

Since you’re not the first one asking for that validator I’ll put it there.

1
ratS 66
[ ( ratS [ ratS ( ratS ratS ) ] [ ratS ( ratS ratS ) ] ) ( ratS [ ratS ( ratS ratS ) ] [ ratS ( ratS ratS ) ] ) ]

Is it the fourth validator ?
My code didn’t pass the fourth and I don’t understand why :frowning:

I posted the last one but apparently the 4th one poses problem too, here you go.

Btw is there a spoiler tag on this forum ?

5
Hotel 7
India 56
Juliet 24
Kilo 5
Lima 7
( Hotel [ India ( [ Juliet ( Kilo Lima ) ] ) ] )

Yeah. It consists in not posting what you don’t want to spoil. Or using DMs, perhaps ?

I’ve sent PMs several times for other puzzles, it gets old really fast.

Thank you for your answer Djoums.
There was a case I didn’t take into account with the way my code reduce the given pattern : ( [ A ] ) or [ ( A ) ]

Thanks,

My mistake was to want to keep only one character by resistance, so to success it I’ve changed it to String :slight_smile:

for the record @Djoums @BlaiseEbuth I’m fine with you sharing validators publicly to unlock blocked players

I know that you are. I’m not. But that’s not to me to decide what’s allowed.

Although the sample test cases pass, my code is failing the Test Case 3 (Combined). I am guessing after going through this forum that it is related to fractional calculations maybe. But then why is the Parallel only test case passing?

Summary

I am using the reduce method to add up even the fractional parts of the parallel connection. And I round the result at the end when all resistors are done. Unrelated - am using regex to handle the innermost group of resistors first.

Is there something wrong in this approach? Does JS start to round off decimals ?

Hi,
Just to make sure I got you right: did your code pass all tests except the ‘Combined’ one, or did you try only ‘Series’, ‘Parallel’ and ‘Combined’ and failed on ‘Combined’ without going any further ?
Anyway, it’s not so easy to answer your question without seeing your code (of course, you can’t post it here, but you can send it in PM), especially to see how exactly you are using reduce().
JS is well known to be poor at handling small numbers with decimals, but I didn’t run into any problem of this kind when solving this puzzle.

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)