Skip to content

Instantly share code, notes, and snippets.

View masiht's full-sized avatar

Masih Tabrizi masiht

View GitHub Profile
@AdrianFerreyra
AdrianFerreyra / sumNestedArray.swift
Created November 6, 2017 03:04
Given an array that contains numbers and/or other nested arrays, write an algorithm to come up with a sum of these elements, multiplied by the depth (or how many arrays deep) you are.
/*
Given an array that contains numbers and/or other nested arrays, write an algorithm to come up with a sum of these elements, multiplied by the depth (or how many arrays deep) you are.
For example, what would you do with an input array that looks like:
[ 2, 3, [ 9, [ 1, 2 ]], 4]
*/
import Foundation
@simonista
simonista / .vimrc
Last active May 21, 2024 09:46
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on