Joke aside, I want to see your contribution, in the form of a "higher level" language's code solving this. I'm pretty sure Haskell or J could do it in a few lines, but if you're talking about Java...
Oh, looks like another contest who writes the longest and uggliest code for solving a trivial problem that can be coded in a few short lines in some higher-level language ;)
Who do you think makes it possible for you to be able to write in a few short lines ? Yo.
I'm pretty sure Haskell or J could do it in a few lines, but if you're talking about Java...
I didn't think about raw Java. I'd expect Java to be similar in verbosity to the STL version. Regarding collections STL finally got to the point of expressivity of Java, but can't beat modern Java i.e. Groovy, Clojure or Scala, or even Java with Guava.
Oh, looks like another contest who writes the longest and uggliest code for solving a trivial problem that can be coded in a few short lines in some higher-level language ;)
xerzi:
Who do you think makes it possible for you to be able to write in a few short lines ? Yo.
Here is my high level solution; 2 lines long. It doesn't get much more elegant than this.
1 2
#include <mylowlevelsolution>
int main() {breakCode();}
I'm willing to bet all of my money that nobody can write a shorter solution with Java.
Oh, looks like another contest who writes the longest and uggliest code for solving a trivial problem that can be coded in a few short lines in some higher-level language ;)