Alternate solution to Shape Up?

I managed to get the correct output with a different code than the one required…it was much simpler than the one needed