Skip to content

Instantly share code, notes, and snippets.

View iamjono's full-sized avatar
🏠
Working from home in a COVID Reclusion

Jonathan Guthrie iamjono

🏠
Working from home in a COVID Reclusion
View GitHub Profile

Keybase proof

I hereby claim:

  • I am iamjono on github.
  • I am iamjono (https://keybase.io/iamjono) on keybase.
  • I have a public key ASBfJQnO3qiS8KTVfZOY5iv1RAh6cI9Ejo8SdkYQQoE_VQo

To claim this, I am signing this object:

@iamjono
iamjono / flatten.swift
Last active April 4, 2019 15:08
Flattens a nested array of integers to [Int]
/**
* Flatten
* A function designed to recursively flatten nested array of integers to a single array of integers
* - parameter: a single element of type [Any]
* - returns: an array of integers [Int]
*/
func flatten(_ a: [Any]) -> [Int] {
// Initialize the internal storage array
var container = [Int]()