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
| open class Something<WTF>(val wtf: WTF) | |
| { | |
| init { | |
| println("init something") | |
| } | |
| } | |
| interface Blargh<T> { | |
| fun getArg(): T | |
| } |
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
| package board | |
| import board.Direction.* | |
| fun createSquareBoard(width: Int): SquareBoard = ConcreteSquareBoard(width) | |
| fun <T> createGameBoard(width: Int): GameBoard<T> = ConcreteGameBoard(createSquareBoard(width)) | |
| private fun Cell.coordinate(direction: Direction) = | |
| when (direction) { |
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
| public class Finally { | |
| public static int tryFinally() { | |
| try { | |
| return 1; | |
| } finally { | |
| System.out.println("Finally block"); | |
| } | |
| } |
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 kotlin.math.max | |
| fun add(left: List<Int>, right: List<Int>) : List<Int> { | |
| val l = left.asReversed() | |
| val r = right.asReversed() | |
| val result = mutableListOf<Int>() | |
| val max = max(l.size, r.size) | |
| var carry = 0 | |
| repeat(max) { |
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
| package com.wcang; | |
| import java.time.Duration; | |
| import java.time.Instant; | |
| import java.util.List; | |
| import java.util.function.Function; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.IntStream; | |
| public class Main { |
OlderNewer