3 ms·
Well the 99-problems were originally in Prolog, and many have to do with list manipulation, something that Haskell has built in. Additionally, Haskell will bene
by stepvhen 10y ago
Well the 99-problems were originally in Prolog, and many have to do with list manipulation, something that Haskell has built in. Additionally, Haskell will benefit from its lazy, functional nature, which makes dynamic programming, searching, and even some data structures a little cleaner.
I haven't worked with Java in quite a while, but I imagine that it still requires a lot of boilerplate and set up for trivial things in other languages. I'm sure if C were also included it would be the most verbose.
- spullara 10y agoJava does still include some boilerplate for setting up classes — though that may go away in 10 when they add scripting. However, it is a lot more terse than in 7: package com.shekhargulati.ninetynine_problems._02_arithmetic; import java.util.stream.LongStream; /** * (**) Determine whether a given integer number is prime. */ public class P31 { public static boolean isPrime(long number) { return !LongStream.rangeClosed(2, Math.round(Math.sqrt(number))).anyMatch(n -> number % n == 0); } }