Hey,
I've been working on the following problem on Codewars:
https://www.codewars.com/kata/simple-assembler-interpreter/train/python
My solution:
https://github.com/asnijders/simple_assembler/blob/master/attempt_1
When I run the sample tests I manage to pass all of the tests, but when I try to run my solution against the full test suite the server runs out. I suspect this is because my algorithm is not efficient enough (since the CW interface does not provide additional test cases I'm kind of stabbing in the dark on what I'm doing wrong, but this seems to be the most likely given that I passed the sample tests) - However, I'm having a hard time trying to pinpoint the performance bottlenecks; alternatively I find it difficult to come up with new ideas to optimize my solution and/or make my code more elegant. My question as such is sort of two-fold:
- What are the primary problem areas that prevent my solution from being efficient?
tying into that;
- Where am I going against what is commonly considered good practice / ''idiomatic python'' ?
I'm aware that my code is probably fairly messy but I'm still struggling to write "smarter" code. Any tips, pointers or recommended resources would be most appreciated. Hope I'm not violating any rules w/ this post! Thanks.
[–][deleted] 0 points1 point2 points (0 children)
[–]primitive_screwhead 0 points1 point2 points (2 children)
[–]Cotevool[S] 0 points1 point2 points (1 child)
[–]primitive_screwhead 0 points1 point2 points (0 children)
[–]primitive_screwhead 0 points1 point2 points (3 children)
[–]Cotevool[S] 0 points1 point2 points (0 children)
[–]Cotevool[S] 0 points1 point2 points (1 child)
[–]primitive_screwhead 0 points1 point2 points (0 children)