I agree with everything hobovsky said. This solution happened to pass because of an implementation detail of the tests, but I just made them a bit stricter, and the solution should now be rejected.
I don't see this solution in the list of solutions though. Neither in the passing nor in the invalidated ones. What's going on? Did you actually submit it? Or maybe some Codewars worker queue simply hasn't caught up yet?
But here you should be careful. Because '/' is integer division.
So (a / 2) * 3 is not same as (a * (3 / 2)) i.g. a == 1
My gut tells me that this additional feature will be implemented through many crutches :)
That's the question I got from a company's coding assessment, I agree, there is some information doesn't clarified, and I try what you said in my code and try that test again , but stll left 3 test cases couldn't pass, unfortunately, all the weighted test cases are hiden.
Oh yeah, true.
The case I was surprised there was no test for was
1 + x + 2
should simplify tox + 3
, but I definitely had fun regardlessThis comment is hidden because it contains spoiler information about the solution
I agree with everything hobovsky said. This solution happened to pass because of an implementation detail of the tests, but I just made them a bit stricter, and the solution should now be rejected.
I don't see this solution in the list of solutions though. Neither in the passing nor in the invalidated ones. What's going on? Did you actually submit it? Or maybe some Codewars worker queue simply hasn't caught up yet?
This comment is hidden because it contains spoiler information about the solution
But here you should be careful. Because '/' is integer division.
So (a / 2) * 3 is not same as (a * (3 / 2)) i.g. a == 1
My gut tells me that this additional feature will be implemented through many crutches :)
That's the question I got from a company's coding assessment, I agree, there is some information doesn't clarified, and I try what you said in my code and try that test again , but stll left 3 test cases couldn't pass, unfortunately, all the weighted test cases are hiden.