My Quick-And-Dirty Exercism Solutions
I started playing with the Java exercises. I am planning to do exercises in other languages like OCaml and Python, but maybe later, when I am done with the Java ones.
My solutions are quick-and-dirty because I focus only on passing the provided tests. I don't mind about performance or speed, or scalability, or about idiomatic code, or about adding other tests to those already provided. I don't even bother putting too many comments in the code. And I don't submit my solutions to the exercism site.
As usual when programming, there is more than one possible solution for a particular problem, but I only keep one of them. It may not be the best solution when it comes to speed, etc., but once again, this is quick-and-dirty stuff.
As a side note, I found myself using a functional language style when writing Java code. For example, instead of using a typical for
loop, I tend to use the forEach
method when/if possible or when/if I want to. Also, some lambda expressions here and there. Why not?
Exercises done so far in Java:
Name | Class file | |
---|---|---|
01 | Hello World | HelloWorld.java |
02 | Etl | Etl.java |
03 | Nucleotide Count | DNA.java |
04 | Word Count | WordCount.java |
05 | Pangram | Pangrams.java |
06 | Anagram | Anagram.java |
07 | Hamming | Hamming.java |
08 | Bob | Bob.java |
09 | Robot Name | Robot.java |
10 | Meetup | Meetup.java |
11 | Phone Number | PhoneNumber.java |
12 | Grade School | School.java |
13 | Space Age | SpaceAge.java |
14 | Gigasecond | Gigasecond.java |
15 | Triangle | Triangle.java |
16 | Acronym | Acronym.java |
17 | Scrabble Score | Scrabble.java |
18 | Roman Numerals | RomanNumeral.java |
19 | Binary | Binary.java |
20 | Prime Factors | PrimeFactors.java |
21 | Raindrops | Raindrops.java |
22 | Allergies | Allergies.java |
23 | Strain | Strain.java |
24 | Atbash Cipher | Atbash.java |
25 | Accumulate | Accumulate.java |
26 | Crypto Square | Crypto.java |
27 | Trinary | Trinary.java |
28 | Rna Transcription | RnaTranscription.java |
29 | Hexadecimal | Hexadecimal.java |
30 | Sieve | Sieve.java |
31 | Simple Cipher | Cipher.java |
32 | Octal | Octal.java |
33 | Luhn | Luhn.java |
34 | Pig Latin | PigLatin.java |
35 | Simple Linked List | SimpleLinkedList.java |
36 | Linked List | Deque.java Node.java |
37 | Nth Prime | Prime.java |
38 | Pascals Triangle | PascalsTriangle.java |
39 | Beer Song | BeerSong.java |
And I am done with the Java track. All the exercises are done (pass the tests), unless they add more of them.