Ok, i will unpublish the translation
Agree with FArekkusu. The JS version is an 8 kyu, and more of a riddle where REDACTED is the literal exact answer.
Trying to implement the same type coersion logic in other languages is going to result in a different level of challenge.
Some other languages have booleans that either are integers (e.g. C) or will coerce to integers (e.g. PHP) and I think could be translated here.
There are two language types that won't work here, languages where there's no type coersion or natural ordering between boolean values and numeric values, or languages like python where REDACTED is valid syntax and works the way you'd mathematically expect.
It is now.
And what more wierd is that sum is not in invalid(perhaps that's allowed?)
invalid = ('__add__', '-', '+', 'exec', 'eval', 'operator', 'reduce')
There're numerous other workarounds available. This fork using sum is only a proof of that.
You need to fix something as your anti-cheats are not working as intended:
add = __import__(''.join(['op',"erator"])).add
will by-pass all of them.
why don't you publish your translation in the kata discourse?
IMO the understanding the description is the hardest part of this kata. It should be clearer.
Didn't even think of using that function for this...
IMO a more detailed example (step by step) shoud be necessary in this kata description.
I think it is now.