This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kotlin.math.ceil | |
| fun friendly(a: Int, b: Int) : Boolean { | |
| val evenA: MutableList<Int> = mutableListOf() | |
| val evenB: MutableList<Int> = mutableListOf() | |
| for (n in 1..a) { | |
| if (a % n == 0 && n != a) { | |
| evenA.add(n) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun fezzBuzz() { | |
| for (i in 1..100) { | |
| if (i % 3 == 0 && i % 5 == 0) { | |
| println("FizBuzz") | |
| } else if (i % 3 == 0) { | |
| println("Fizz") | |
| } else if (i % 5 == 0) { | |
| println("Buzz") | |
| } else { | |
| println(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // swift 3 | |
| let email = "foo@bar.com" | |
| if let url = URL(string: "mailto:\(email)") { | |
| UIApplication.shared.openURL(url) | |
| } |