Skip to content

Instantly share code, notes, and snippets.

@gilo
Created March 30, 2019 16:58
Show Gist options
  • Select an option

  • Save gilo/38f83aa5bcfa9f4e87b414dbcd981444 to your computer and use it in GitHub Desktop.

Select an option

Save gilo/38f83aa5bcfa9f4e87b414dbcd981444 to your computer and use it in GitHub Desktop.
// 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