Solution to Unique Paths Problem