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 java.util.ArrayList; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class FisrtThenLastOrder { | |
public static void main(String... args) { | |
Scanner scanner = new Scanner(System.in); | |
int number = scanner.nextInt(); |
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 android.app.Activity | |
import android.app.Service | |
import android.content.ComponentName | |
import android.content.Context | |
import android.content.Intent | |
import android.content.Intent.EXTRA_SUBJECT | |
import android.content.Intent.EXTRA_TEXT | |
import android.net.Uri | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KClass |
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 java.util.Arrays | |
val inventory = Array<Elem>(size = 3) { Empty } | |
fun main(args: Array<String>) { | |
val sword1 = Sword("Sword 1") | |
val sword2 = Sword("Sword 2") | |
val pickaxe = Pickaxe("Pickaxe 1") | |
val item1 = Item(sword1) | |
val item2 = Item(sword2) |
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 java.util.Arrays | |
val inventory = Array<Elem>(size = 3) { Empty } | |
fun main(args: Array<String>) { | |
val sword1 = Sword("Sword 1") | |
val sword2 = Sword("Sword 2") | |
val pickaxe = Pickaxe("Pickaxe 1") | |
val item1 = Item(sword1) | |
val item2 = Item(sword2) |
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
ReactorApi{ | |
@Get fun visits(): Chainable<VisitsResult> | |
} | |
BillingApi{ | |
@Post fun billing(): Chainable<BillingResult> | |
} |
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
<html> | |
<body> | |
<a href="sxsw-hitchcock://user?OTP=456">Link</a> | |
</body> | |
</html> |
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
/* | |
Tablero de control | |
Nivel 1 | |
Profesor Sesion 1 Sesion 2 Sesion 3 Sesion 4 | |
Pepito _ _ _ _ _ _ _ _ _ _ _ | |
Menganita _ _ _ _ _ _ _ _ _ _ _ | |
Sultaneira _ _ _ _ _ _ _ _ _ _ _ | |
Nivel 2 |
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
func partition<T: Comparable>(inout array: [T], first: Int, last: Int) -> Int { | |
let pivot = first | |
let pivotVal = array[pivot] | |
(array[first], array[pivot]) = (array[pivot], array[first]) | |
var i = first + 1 | |
var j = first + 1 | |
while j < last { | |
if array[j] < pivotVal { | |
(array[i], array[j]) = (array[j], array[i]) | |
i += 1 |
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 Foundation | |
/** | |
Counts the number of inversions on the given array. | |
- Returns: the number of the inversions. | |
*/ | |
func countInversions(arr:[Int]) -> Int { | |
guard arr.count > 1 else {return 0} | |
let middle: Int = Int(ceil(Double(arr.count/2))) | |
let left: [Int] = Array(arr[0..<arr.count/2]) |
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 Foundation | |
/** | |
Sorts an array using the merge arrangement, which relays in order the left & right half arrays in a major set of elements. giving a complexity of O(n log n). | |
- Returns: An ordered array. | |
*/ | |
func mergeSort(arr:[Int]) -> [Int] { | |
guard arr.count > 1 else {return arr} | |
let middle: Int = Int(ceil(Double(arr.count/2))) | |
let left: [Int] = mergeSort(Array(arr[0..<arr.count/2])) |