solved in lisp
solved in lisp, but complexity is O(2^n)
solved in python, but untested
fixed split function and stack overflow, but still some issues