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 | |
} | |
} |
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
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
OlderNewer