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 UIKit | |
// | |
////Hvilken type er `value`? | |
// | |
//let value0 = 42 | |
// | |
//var value1: String = "10" + "lsddsakndas njk" | |
//value1 += "dfklmf" | |
// | |
//let value2: Int = 10 |
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 UIKit | |
//Hvilken type er `value`? | |
let value0 = 42 | |
var value1: String = "10" + "lsddsakndas njk" | |
value1 += "dfklmf" | |
let value2: Int = 10 |
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
class Solution { | |
func findMedianSortedArrays(_ nums1: [Int], _ nums2: [Int]) -> Double { | |
let nums = (nums1 + nums2).sorted() | |
if nums.count % 2 == 1 { | |
return Double(nums[Int(nums.count / 2)]) | |
} | |
return Double(nums[Int(nums.count / 2) - 1] + nums[Int(nums.count / 2)]) / 2.0 | |
} | |
} |
OlderNewer