5 ms·
Sure! Optimizing for number of lines (instead of number of characters): * Remove 'import numpy as n' and use __import__('numpy') in place of it everywhere *
by earenndil 8y ago
Sure! Optimizing for number of lines (instead of number of characters):
* Remove 'import numpy as n' and use __import__('numpy') in place of it everywhere
* Remove s and d functions; inline them where they're called
* Get rid of 'class N', as it's unnecessary. If adding globals is cheating, then you can do '__import__('math').x = x' instead of 'self.x = x' (yes this will work and persist).
* Technically, you don't have to print the result at the end
Where do I go for my beer?
- vesche 8y agohttps://i.imgur.com/DpSQVCh.png https://i.imgur.com/DpSQVCh.png