Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My:
- object LowIntSum {
- def sumTwoSmallest(numbers: List[Int]): Int = {
- val x=numbers.min
- numbers.filterNot(n=>n==x).min+x}
- }
- Other:
- object LowIntSum {
- def sumTwoSmallest(numbers: List[Int]): Int =
- numbers.sorted.take(2).sum
- }
Add Comment
Please, Sign In to add comment