WWDC 2001 2002 2003 2004 2007 2008 2009 2010 2011 2012 2013
This file contains 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
{ | |
"app-store-connect": { | |
"101 TestFlight": [ | |
"https://devstreaming-cdn.apple.com/videos/tutorials/TestFlight_App_Store_Connect_2018/TestFlight_App_Store_Connect_2018_hd.mp4", | |
"https://devstreaming-cdn.apple.com/videos/tutorials/TestFlight_App_Store_Connect_2018/TestFlight_App_Store_Connect_2018_sd.mp4" | |
], | |
"102 App Analytics Overview": [ | |
"https://devstreaming-cdn.apple.com/videos/tutorials/Analytics_Overview_Pt2/Analytics_Overview_hd.mp4", | |
"https://devstreaming-cdn.apple.com/videos/tutorials/Analytics_Overview_Pt2/Analytics_Overview_sd.mp4" | |
], |
This file contains 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
@Override | |
public String replaceThe(String str) { | |
StringBuilder res = new StringBuilder(); | |
String vo = "aeiou"; | |
String[] part = str.split("the"); | |
res.append(part[0]); | |
for (int i = 1; i < part.length; i++) { | |
if (vo.contains(part[i].trim().charAt(0) + "")) { |
This file contains 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.pow | |
override fun isNarcisstic(num: Int): Boolean { | |
return when { | |
num < 10 -> true | |
num < 100 -> false | |
else -> num == ("" + num).chars() | |
.map { cp -> Character.getNumericValue(cp).toDouble().pow(("" + num).length.toDouble()).toInt() } | |
.sum() | |
} |
This file contains 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
private static int countMatches(Matcher matcher) { | |
int counter = 0; | |
while (matcher.find()) | |
counter++; | |
return counter; | |
} | |
@Override | |
public String firstNVowels(String str, int n) { | |
Pattern pattern = Pattern.compile("(?i)[aeiou]"); |
This file contains 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
func grabCity(_ str: String) -> String { | |
// the commented line below (the regex to be exact) gets just the last word! which is wrong, my fault though, i didn't read the challenge corectly! | |
// let regex = try! NSRegularExpression(pattern: "(\\w+)(?!.*\\w)", options: []) | |
// the regex below get every matches in the sentence that is being wrapped in a pair of square brackets. | |
let regex = try! NSRegularExpression(pattern: "(?<=\\[)(.+?)(?=\\])", options: []) | |
// the "result" below is of type NSTextCheckingResult which is an array, since the challenge askes for the last match, and i couldn't get the last match through the regex, i ened up gtting the last match via the "last" item in the array. | |
let result = regex.matches(in: str, options: [], range: NSRange(location: 0, length: str.count)).last | |
/* | |
// from line 11 to 18, is an alternative for getting the matches out of the result array, since it is an array (of type NSTextCheckingResult) you can iterate thtough it (loop though it) | |
// you can use each o |
This file contains 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
func grabCity(_ str: String) -> String { | |
// let regex = try! NSRegularExpression(pattern: "(\\w+)(?!.*\\w)", options: []) | |
let regex = try! NSRegularExpression(pattern: "(?<=\\[)(.+?)(?=\\])", options: []) | |
let result = regex.matches(in: str, options: [], range: NSRange(location: 0, length: str.count)).last | |
/* | |
for match in result { | |
for n in 0..<match.numberOfRanges { | |
let range = match.range(at: n) | |
let r = str.index(str.startIndex, offsetBy: range.location)..<str.index(str.startIndex, offsetBy: range.location+range.length) | |
// print(#line, #file.components(separatedBy: "/").last!, str.substring(with: r)) |
This file contains 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
func sumOfMultiplesOfThreeAndFiveBelowN(inputs: [UInt64?]) { | |
for input in inputs { | |
var res: UInt64 = 0 | |
if let num = input, num > 0 { | |
for i in 1..<num { | |
if i % 3 == 0 || i % 5 == 0 || ((i % 3 == 0) && (i % 5 == 0)) { | |
res += i | |
} | |
} |