Skip to content

Instantly share code, notes, and snippets.

@danfitch
Created February 25, 2021 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danfitch/768ccfceddbe26f29c0a81aee463e033 to your computer and use it in GitHub Desktop.
Save danfitch/768ccfceddbe26f29c0a81aee463e033 to your computer and use it in GitHub Desktop.
Given an array of strings [‘one’, ‘two’, ‘three’, ‘three’, ‘four’] write a function that will remove duplicates returning [‘one’, ‘two’, ‘three’, ‘four’]
func (arry) {
...
return arr
}
Given an array of integers [‘one’, ‘two’, ‘three’, ‘three’, ‘four’] write a function that takes an array and string and returns the number of elements.
func (arry, entr) {
...
return count
}
func ([‘one’, ‘two’, ‘three’, ‘three’, ‘four’], ‘one’) returns 1
func ([‘one’, ‘two’, ‘three’, ‘three’, ‘four’], ‘three’) returns 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment