Created
March 30, 2019 16:58
-
-
Save gilo/38f83aa5bcfa9f4e87b414dbcd981444 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Assume we have a slice of points, where type Point struct {X, Y int} | |
| // Write a function sortPoints(points []*Point, origin *Point) []*Point that will return a sorted slice of the points | |
| // according to their distance from origin. The original points parameter should not be affected. You should use the sort | |
| // package and not implement your own sorting. | |
| func sortPoints(points []*Point, origin *Point) []*Point { | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment