Create goal.R

Add another R solution for the problem.