Added solution to problem 36

Updated as commit title was wrong. Removed empty lines and indented the code