     
     return sum
 }
-powerOfN(2, power: 4)
+// test it:
+powerOfN(2, power: 4) // 16
 powerOfN(0, power: 4) // 0
 powerOfN(1, power: 4) // 1
 powerOfN(2, power: 1) // 2
 powerOfN(2, power: 0) // 1
 
 
-
-
-
-
-
-
-
-
-
+// take in string, return letter that appears the most frequently
+func mostCommonLetter(word: String) -> String {
+
+    var tracker: Dictionary<Character,Int> = [:]
+    let commonLetter: String
+    
+    for letter: Character in word.characters {
+        if !tracker.keys.contains(letter) {
+            tracker[letter] = 1
+        } else {
+            for (_, value) in tracker {
+                tracker[letter] = value + 1
+            }
+        }
+    }
+    commonLetter = findCommonLetter(tracker)
+    return commonLetter
+}
+
+func findCommonLetter(dictionary: [Character: Int]) -> String {
+    var max = 1
+    var letter = " "
+
+    for (key, value) in dictionary {
+        if value > max {
+            max = value
+            letter = String(key)
+        }
+    }
+return letter
+}
+mostCommonLetter("heelllpppp") // test it
 
 
 
 // check array for missing number in consecutive numbers, return that number (to reuse numbers)
 
 // assign that number to a customer
-
-
-// take in string, return letter that appears the most frequently
-//func mostCommonLetter(word: String) -> String? {
-//    
-//    var tracker: Dictionary<String,Int> = [:]
-//    
-//    var count: Int = 1
-//    let wordArray = word.characters.map {String($0)} // convert to array of strings
-//    
-//    var letter: String? = nil
-//    var largestNumber = 0
-//    
-//    for letter in wordArray {
-//        
-//        if !tracker.keys.contains(letter) {
-//            tracker[letter] = count
-//        } else {
-//            
-//        }
-//  
-//    }
-//    
-//    print(tracker)
-//
-//    return letter
-//}
-//    
-//
-//mostCommonLetter("heellloe")
-
-
 
 //adding / multiplying / traversing multi dimensional arrays
 //caesar cypher
 //tic tac toe
-//Check to see if string is balanced (())
 //Given three numbers return the median
 //Fibonacci - given an idx return the fib value at idx
 //given a jumble: String and knownWords: [String] return list of potential words that the string may be.

addValues(arr2)


// create function that determines n power of n
func powerOfN(number: Int, power: Int) -> Int {
    var sum = 1
    
    if power == 0 {
        return 1
    }
    

    var stack = Stacky<Character>(items: Array(word.characters))
    var reverseStack = Stacky<Character>(items: Array(word.characters).reverse())
    
    for _ in 0..<stack.count() { // O(n)
        if stack.pop() != reverseStack.pop() { // O(1)
            return false
        }
    }
