add: slice exercises

This commit is contained in:
Inanc Gumus
2019-01-22 20:32:32 +03:00
parent d2be3d6692
commit 69fe30b2ee
15 changed files with 210 additions and 83 deletions

View File

@ -0,0 +1,38 @@
// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
// ---------------------------------------------------------
// EXERCISE: Compare the slices
//
// 1. Split the namesA string and get a slice
//
// 2. Sort all the slices
//
// 3. Compare whether the slices are equal or not
//
//
// EXPECTED OUTPUT
//
// They are equal.
//
//
// HINTS
//
// 1. strings.Split function splits a string and
// returns a string slice
//
// 2. Comparing slices: First check whether their length
// are the same or not; only then compare them.
//
// ---------------------------------------------------------
func main() {
// namesA := "Da Vinci, Wozniak, Carmack"
// namesB := []string{"Wozniak", "Da Vinci", "Carmack"}
}