so I'm not a programmer) just remembered institute years
all wanted to be rewritten to use only one array, but was too lazy) ---------- Posted 18.06.2020 at 12:46 ---------- Gerga, you have to throw out all that great $ target? as well as the same amount with a negative number?
you can add a check for a negative number and filter in the opposite direction, but it is still clearly faster than without such a filter.
Your implementation has not passed the test with [0,4,3,0] and Target 0, return was [0, 3], and returned empty array. If Fixed, run a test, look at how much faster option, but your implementation seems to me to be as long in pyhe no tail recursion optimization.
The idea with the exception of numbers more than $ target, I also implemented, but I zafeylili test with the amount which a single number is negative, as stated above tommy-gung.
Danforth, took into account the 0 and a negative number https://pastebin.com/JDPYysWF .
Danforth, yes, if so, then this filter will not help ...
Gerga, a little problem here , there is an opportunity to throw the code in the test and see the result of execution speed and memory consumption. There is also a hint for those who did not think himself. I recommend to all before the climb to the tips to think about how you can speed up, the solution is very simple.
For example, my last realization in Rust.
🍾 Well ok, changed
Above there is a link where you can get rid of the tests
Danforth, I put the wrong flag and eventually was generally non-working code that is executed only one time)
I corrected, but now the test fails Output Limit Exceeded
To post a new comment, please log in or register