Skip to content

Instantly share code, notes, and snippets.

@gilo
Created March 30, 2019 16:58
Show Gist options
  • Save gilo/38f83aa5bcfa9f4e87b414dbcd981444 to your computer and use it in GitHub Desktop.
Save gilo/38f83aa5bcfa9f4e87b414dbcd981444 to your computer and use it in GitHub Desktop.

Revisions

  1. Gil Ochayon created this gist Mar 30, 2019.
    8 changes: 8 additions & 0 deletions Go workshop exercise #1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    // 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 {

    }