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 scala.annotation.tailrec | |
def sum(numbers: Seq[Int]): Int = | |
if (numbers.isEmpty) 0 | |
else numbers.head + sum(numbers.tail) | |
def product(numbers: Seq[Int]): Int = | |
if (numbers.isEmpty) 1 | |
else numbers.head * product(numbers.tail) |
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 java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
enum Color { | |
RED, GREEN; | |
} | |
class Apple { |
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 java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
enum Color { | |
RED, GREEN; | |
} | |
interface Vegetable { |
NewerOlder