Skip to content

Instantly share code, notes, and snippets.

import UIKit
//Hvilken type er `value`?
let value0 = 42
var value1: String = "10" + "lsddsakndas njk"
value1 += "dfklmf"
let value2: Int = 10
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
}
}
/*
* 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