Instructor: Jared Warren
Date: 2020-03-26
What is the difference between Atomic and Non-Atomic? Copy, Nonatomic etc.. readonly, atomic, readwrite,
Best resource: https://academy.realm.io/posts/tmi-objective-c-property-attributes/
import Foundation | |
// a coding exercise from repl.it motivated me to learn how to convert numbers (specifically integers) into strings | |
// In part 1, I explored the different ways to convert an integer simply to a string. so if you're given the int 9, you should output the string literal "9" | |
// several solutions were put forth from https://stackoverflow.com/questions/24161336/convert-int-to-string-in-swift | |
var x: Int = 9 | |
var s = String(x) // this one makes the most sense to me | |
var ss = "\(x)" |
import UIKit | |
/* | |
Find the minimum absolute difference between any two numbers in an array. | |
func minimumAbsDifference(_ array: [Int]) -> Int { | |
// your code goes here | |
} | |
[5, 9, 33, 2] -> 3 |
import UIKit | |
//Write a function that accepts an Int and prints out a sideways pyramid of that height. | |
func pyramid(height: Int) { | |
for i in 1...height { | |
printStarline(height: i) | |
} | |
for i in stride(from: height-1, to: 0, by: -1) { | |
printStarline(height: i) |
// | |
// main.m | |
// Stretch Problem 4.3 - HighestNumberInArray | |
// | |
// Created by theevo on 3/25/20. | |
// Copyright © 2020 Theo Vora. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
// | |
// main.m | |
// Stretch Problem 4.4 - FizzBuzz ObjC | |
// | |
// Created by theevo on 3/26/20. | |
// Copyright © 2020 Theo Vora. All rights reserved. | |
// | |
/* | |
Write a method that prints the numbers from 1 to an inputed number. But for multiples of three print "Dev" instead of the number and for the multiples of five print "Mtn". For numbers which are multiples of both three and five print "DevMtn". | |
*/ |
Instructor: Jared Warren
Date: 2020-03-26
Best resource: https://academy.realm.io/posts/tmi-objective-c-property-attributes/
//: [Palindrome](@previous) | |
/*: | |
# Thursday Stretch Problem 5.4 | |
## Greatest Common Divisor | |
### Instructions | |
- Read about recursion. | |
- Note Google's little joke when you search recursion in Chrome. | |
- Create a function that returns the greatest common divisor of two numbers using recursion. (function calling itself). | |
*/ |
//: [Palindrome](@previous) | |
/*: | |
# Thursday Stretch Problem 5.4 | |
## Greatest Common Divisor | |
### Instructions | |
- Read about recursion. | |
- Note Google's little joke when you search recursion in Chrome. | |
- Create a function that returns the greatest common divisor of two numbers using recursion. (function calling itself). | |
*/ |
/*: | |
# Tuesday Stretch Problem 5.2 | |
## Longest Word In String | |
### Instructions | |
- Write a function that takes a string and returns the biggest word in that string. | |
- Make sure to remove punctuation and whitespace. | |
``` | |
longestWord("This string, has a gigantic! word in it...") // returns "gigantic" | |
longestWord("one, two, three") // returns "three" |