Problem #1 Version 2

Less than half the lines of code