Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
bad practice
This code looks good but I fail to see how it entertains the possibility that the left side of the array's sum could be 0 (the sum of all elements in the array except for the last element equals 0)
yes but your code is very cluttered. You add a lot of extra steps. Just check if lsum == right sum after updating rsum but before updating lsum. That way you automatically handle an array of len 1 and you don't need to introduce a divider variable.
Just what I came up few seconds ago...
Maybe not the most efficient but, I mean, first passing all the tests, is what matters most :). Improving is another step though.
if he used const that makes him can't erase
It's bad practice to remove them. It's relying on the tests to include them instead, which leaves these solutions prone to being automatically invalidated in the future if the tests change and their solutions don't compile anymore. The line or two saved by omitting them isn't worth that risk, so you're doing good by keeping them in
why theres no #include
i tried it without the lib but dosnt work for me
clean code but is O(n^2) complexity. There is a O(n) solution.
Very readable and logical. Oh, this language design...
Hooray! I'm part of the most common solution group :D
likewise ðŸ˜
where did 'const' go?
Good point...
why most "best practices" is for solution that do two sums in every round?
This comment is hidden because it contains spoiler information about the solution
Loading more items...