Functional Programming

1 minute read

One awkwardness I haven’t really get rid of when using Clojure is for loops. Especially nested for loops that modifies some global variables. I find some solutions online where people use nested recursion or atoms, but can we just use one level of recursion? Let’s try out with a coding kata. Problem: Given an array of numbers, find the biggest sum of any two numbers. The same item in array cannot be used twice.