These solutions will focus on time complexity as the primary constraint.
I will not be so concerned with space complexity.
I will also not be focused on code optimization, and as such the time in absolute milliseconds may be deceptive in terms of algorithm performance.
You can view .sddoc files with the program SmoothDraw.