All the solutions we discussed and a few additional refinements are shared on the GitHub repository https://github.com/practicalli/codewars-guides/tree/master/maximum-subarray-sum My preferred solution is at the top of the source code file. Thank you all for taking part and suggesting ideas for me to try, very useful.