3 ms·
While the improvement might or might not be worth the cost of figuring it out for this case in isolation, note that a more experienced programmer would write th
by abecedarius 10y ago
While the improvement might or might not be worth the cost of figuring it out for this case in isolation, note that a more experienced programmer would write the final better version first, without even considering looping over the whole 2d array. How do you learn to do that? By revising your code!
If you never get to learn better, you're letting your management force you to retard your own development. Unless you're a temp it's probably even costing your employer more than it gains. Of course, there's a balance between learning and firefighting. Just don't put the fulcrum all the way over on the left edge.