We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Lisa's Workbook
Lisa's Workbook
Sort by
recency
|
943 Discussions
|
Please Login in order to post a comment
Here is my c++ solution , you can watch the explanation here : https://youtu.be/3L-haDbsjAg
Here is my Python solution! I think it can probably be done much faster, but I was too lazy to try to create a more efficient solution.
Here is my rust submission:
It is long but this is the only way I was able to understand properly. Try running it, the println! gives very useful output for figuring the problem out.
python3
Python3, but iterates over all problems N = sum(arr), so it's O(N). I belive it can be done much better