trackler 2.2.1.40 → 2.2.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/dot-dsl/metadata.yml +1 -0
- data/problem-specifications/exercises/etl/metadata.yml +1 -0
- data/problem-specifications/exercises/isogram/canonical-data.json +3 -3
- data/problem-specifications/exercises/ocr-numbers/metadata.yml +1 -0
- data/problem-specifications/exercises/pascals-triangle/metadata.yml +1 -0
- data/problem-specifications/exercises/pov/metadata.yml +1 -0
- data/problem-specifications/exercises/rna-transcription/metadata.yml +1 -0
- data/problem-specifications/exercises/sgf-parsing/metadata.yml +1 -0
- data/tracks/c/exercises/all-your-base/src/example.c +14 -14
- data/tracks/c/exercises/all-your-base/src/example.h +2 -2
- data/tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon +1 -1
- data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/{RNAtest.ceylon → RNATest.ceylon} +0 -0
- data/tracks/cfml/.git +1 -0
- data/tracks/cfml/.gitignore +5 -0
- data/tracks/cfml/.travis.yml +18 -0
- data/tracks/cfml/CONTRIBUTING.md +10 -0
- data/tracks/cfml/LICENSE +21 -0
- data/tracks/cfml/README.md +92 -0
- data/tracks/cfml/bin/fetch-configlet +32 -0
- data/tracks/cfml/config/exercise_readme.go.tmpl +16 -0
- data/tracks/cfml/config/maintainers.json +13 -0
- data/tracks/cfml/config.json +223 -0
- data/tracks/cfml/docs/ABOUT.md +10 -0
- data/tracks/cfml/docs/EXERCISE_README_INSERT.md +15 -0
- data/tracks/cfml/docs/INSTALLATION.md +35 -0
- data/tracks/cfml/docs/LEARNING.md +37 -0
- data/tracks/cfml/docs/RESOURCES.md +29 -0
- data/tracks/cfml/docs/SNIPPET.txt +8 -0
- data/tracks/cfml/docs/TESTS.md +13 -0
- data/tracks/cfml/exercises/acronym/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/acronym/Acronym.cfc +13 -0
- data/tracks/cfml/exercises/acronym/AcronymTest.cfc +43 -0
- data/tracks/cfml/exercises/acronym/Solution.cfc +22 -0
- data/tracks/cfml/exercises/acronym/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/acronym/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/acronym/box.json +8 -0
- data/tracks/cfml/exercises/acronym/index.cfm +37 -0
- data/tracks/cfml/exercises/atbash-cipher/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/atbash-cipher/AtbashCipher.cfc +14 -0
- data/tracks/cfml/exercises/atbash-cipher/AtbashCipherTest.cfc +71 -0
- data/tracks/cfml/exercises/atbash-cipher/Solution.cfc +56 -0
- data/tracks/cfml/exercises/atbash-cipher/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/atbash-cipher/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/atbash-cipher/box.json +8 -0
- data/tracks/cfml/exercises/atbash-cipher/index.cfm +37 -0
- data/tracks/cfml/exercises/bob/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/bob/Bob.cfc +13 -0
- data/tracks/cfml/exercises/bob/BobTest.cfc +115 -0
- data/tracks/cfml/exercises/bob/Solution.cfc +27 -0
- data/tracks/cfml/exercises/bob/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/bob/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/bob/box.json +8 -0
- data/tracks/cfml/exercises/bob/index.cfm +37 -0
- data/tracks/cfml/exercises/diamond/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/diamond/Diamond.cfc +13 -0
- data/tracks/cfml/exercises/diamond/DiamondTest.cfc +35 -0
- data/tracks/cfml/exercises/diamond/Solution.cfc +35 -0
- data/tracks/cfml/exercises/diamond/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/diamond/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/diamond/box.json +8 -0
- data/tracks/cfml/exercises/diamond/index.cfm +37 -0
- data/tracks/cfml/exercises/difference-of-squares/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/difference-of-squares/DifferenceOfSquares.cfc +18 -0
- data/tracks/cfml/exercises/difference-of-squares/DifferenceOfSquaresTest.cfc +63 -0
- data/tracks/cfml/exercises/difference-of-squares/Solution.cfc +28 -0
- data/tracks/cfml/exercises/difference-of-squares/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/difference-of-squares/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/difference-of-squares/box.json +8 -0
- data/tracks/cfml/exercises/difference-of-squares/index.cfm +37 -0
- data/tracks/cfml/exercises/flatten-array/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/flatten-array/FlattenArray.cfc +13 -0
- data/tracks/cfml/exercises/flatten-array/FlattenArrayTest.cfc +42 -0
- data/tracks/cfml/exercises/flatten-array/Solution.cfc +26 -0
- data/tracks/cfml/exercises/flatten-array/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/flatten-array/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/flatten-array/box.json +8 -0
- data/tracks/cfml/exercises/flatten-array/index.cfm +37 -0
- data/tracks/cfml/exercises/gigasecond/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/gigasecond/Gigasecond.cfc +13 -0
- data/tracks/cfml/exercises/gigasecond/GigasecondTest.cfc +39 -0
- data/tracks/cfml/exercises/gigasecond/Solution.cfc +16 -0
- data/tracks/cfml/exercises/gigasecond/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/gigasecond/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/gigasecond/box.json +8 -0
- data/tracks/cfml/exercises/gigasecond/index.cfm +37 -0
- data/tracks/cfml/exercises/grains/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/grains/Grains.cfc +14 -0
- data/tracks/cfml/exercises/grains/GrainsTest.cfc +63 -0
- data/tracks/cfml/exercises/grains/Solution.cfc +22 -0
- data/tracks/cfml/exercises/grains/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/grains/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/grains/box.json +8 -0
- data/tracks/cfml/exercises/grains/index.cfm +37 -0
- data/tracks/cfml/exercises/hamming/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/hamming/Hamming.cfc +13 -0
- data/tracks/cfml/exercises/hamming/HammingTest.cfc +75 -0
- data/tracks/cfml/exercises/hamming/Solution.cfc +25 -0
- data/tracks/cfml/exercises/hamming/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/hamming/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/hamming/box.json +8 -0
- data/tracks/cfml/exercises/hamming/index.cfm +37 -0
- data/tracks/cfml/exercises/hello-world/HelloWorld.cfc +13 -0
- data/tracks/cfml/exercises/hello-world/HelloWorldTest.cfc +18 -0
- data/tracks/cfml/exercises/hello-world/Solution.cfc +13 -0
- data/tracks/cfml/exercises/hello-world/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/hello-world/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/hello-world/box.json +8 -0
- data/tracks/cfml/exercises/hello-world/index.cfm +37 -0
- data/tracks/cfml/exercises/isogram/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/isogram/Isogram.cfc +13 -0
- data/tracks/cfml/exercises/isogram/IsogramTest.cfc +55 -0
- data/tracks/cfml/exercises/isogram/Solution.cfc +23 -0
- data/tracks/cfml/exercises/isogram/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/isogram/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/isogram/box.json +8 -0
- data/tracks/cfml/exercises/isogram/index.cfm +37 -0
- data/tracks/cfml/exercises/largest-series-product/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/largest-series-product/LargestSeriesProduct.cfc +13 -0
- data/tracks/cfml/exercises/largest-series-product/LargestSeriesProductTest.cfc +75 -0
- data/tracks/cfml/exercises/largest-series-product/Solution.cfc +41 -0
- data/tracks/cfml/exercises/largest-series-product/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/largest-series-product/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/largest-series-product/box.json +8 -0
- data/tracks/cfml/exercises/largest-series-product/index.cfm +37 -0
- data/tracks/cfml/exercises/leap/Leap.cfc +15 -0
- data/tracks/cfml/exercises/leap/LeapTest.cfc +39 -0
- data/tracks/cfml/exercises/leap/README.md +33 -0
- data/tracks/cfml/exercises/leap/Solution.cfc +19 -0
- data/tracks/cfml/exercises/leap/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/leap/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/leap/box.json +8 -0
- data/tracks/cfml/exercises/leap/index.cfm +37 -0
- data/tracks/cfml/exercises/luhn/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/luhn/Luhn.cfc +13 -0
- data/tracks/cfml/exercises/luhn/LuhnTest.cfc +67 -0
- data/tracks/cfml/exercises/luhn/Solution.cfc +38 -0
- data/tracks/cfml/exercises/luhn/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/luhn/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/luhn/box.json +8 -0
- data/tracks/cfml/exercises/luhn/index.cfm +37 -0
- data/tracks/cfml/exercises/nth-prime/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/nth-prime/NthPrime.cfc +13 -0
- data/tracks/cfml/exercises/nth-prime/NthPrimeTest.cfc +35 -0
- data/tracks/cfml/exercises/nth-prime/Solution.cfc +33 -0
- data/tracks/cfml/exercises/nth-prime/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/nth-prime/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/nth-prime/box.json +8 -0
- data/tracks/cfml/exercises/nth-prime/index.cfm +37 -0
- data/tracks/cfml/exercises/pangram/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/pangram/Pangram.cfc +13 -0
- data/tracks/cfml/exercises/pangram/PangramTest.cfc +55 -0
- data/tracks/cfml/exercises/pangram/Solution.cfc +21 -0
- data/tracks/cfml/exercises/pangram/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/pangram/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/pangram/box.json +8 -0
- data/tracks/cfml/exercises/pangram/index.cfm +37 -0
- data/tracks/cfml/exercises/pig-latin/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/pig-latin/PigLatin.cfc +13 -0
- data/tracks/cfml/exercises/pig-latin/PigLatinTest.cfc +115 -0
- data/tracks/cfml/exercises/pig-latin/Solution.cfc +30 -0
- data/tracks/cfml/exercises/pig-latin/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/pig-latin/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/pig-latin/box.json +8 -0
- data/tracks/cfml/exercises/pig-latin/index.cfm +37 -0
- data/tracks/cfml/exercises/raindrops/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/raindrops/Raindrops.cfc +13 -0
- data/tracks/cfml/exercises/raindrops/RaindropsTest.cfc +87 -0
- data/tracks/cfml/exercises/raindrops/Solution.cfc +33 -0
- data/tracks/cfml/exercises/raindrops/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/raindrops/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/raindrops/box.json +8 -0
- data/tracks/cfml/exercises/raindrops/index.cfm +37 -0
- data/tracks/cfml/exercises/rna-transcription/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/rna-transcription/RnaTranscription.cfc +13 -0
- data/tracks/cfml/exercises/rna-transcription/RnaTranscriptionTest.cfc +47 -0
- data/tracks/cfml/exercises/rna-transcription/Solution.cfc +35 -0
- data/tracks/cfml/exercises/rna-transcription/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/rna-transcription/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/rna-transcription/box.json +8 -0
- data/tracks/cfml/exercises/rna-transcription/index.cfm +37 -0
- data/tracks/cfml/exercises/saddle-points/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/saddle-points/SaddlePoints.cfc +13 -0
- data/tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc +35 -0
- data/tracks/cfml/exercises/saddle-points/Solution.cfc +59 -0
- data/tracks/cfml/exercises/saddle-points/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/saddle-points/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/saddle-points/box.json +8 -0
- data/tracks/cfml/exercises/saddle-points/index.cfm +37 -0
- data/tracks/cfml/exercises/scrabble-score/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/scrabble-score/ScrabbleScore.cfc +13 -0
- data/tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc +59 -0
- data/tracks/cfml/exercises/scrabble-score/Solution.cfc +50 -0
- data/tracks/cfml/exercises/scrabble-score/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/scrabble-score/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/scrabble-score/box.json +8 -0
- data/tracks/cfml/exercises/scrabble-score/index.cfm +37 -0
- data/tracks/cfml/exercises/secret-handshake/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/secret-handshake/SecretHandshake.cfc +13 -0
- data/tracks/cfml/exercises/secret-handshake/SecretHandshakeTest.cfc +63 -0
- data/tracks/cfml/exercises/secret-handshake/Solution.cfc +31 -0
- data/tracks/cfml/exercises/secret-handshake/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/secret-handshake/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/secret-handshake/box.json +8 -0
- data/tracks/cfml/exercises/secret-handshake/index.cfm +37 -0
- data/tracks/cfml/exercises/space-age/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/space-age/Solution.cfc +28 -0
- data/tracks/cfml/exercises/space-age/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/space-age/SpaceAge.cfc +13 -0
- data/tracks/cfml/exercises/space-age/SpaceAgeTest.cfc +47 -0
- data/tracks/cfml/exercises/space-age/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/space-age/box.json +8 -0
- data/tracks/cfml/exercises/space-age/index.cfm +37 -0
- data/tracks/cfml/exercises/sum-of-multiples/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/sum-of-multiples/Solution.cfc +27 -0
- data/tracks/cfml/exercises/sum-of-multiples/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/sum-of-multiples/SumOfMultiples.cfc +13 -0
- data/tracks/cfml/exercises/sum-of-multiples/SumOfMultiplesTest.cfc +63 -0
- data/tracks/cfml/exercises/sum-of-multiples/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/sum-of-multiples/box.json +8 -0
- data/tracks/cfml/exercises/sum-of-multiples/index.cfm +37 -0
- data/tracks/cfml/exercises/triangle/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/triangle/Solution.cfc +53 -0
- data/tracks/cfml/exercises/triangle/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/triangle/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/triangle/Triangle.cfc +18 -0
- data/tracks/cfml/exercises/triangle/TriangleTest.cfc +95 -0
- data/tracks/cfml/exercises/triangle/box.json +8 -0
- data/tracks/cfml/exercises/triangle/index.cfm +37 -0
- data/tracks/cfml/exercises/word-count/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/word-count/Solution.cfc +22 -0
- data/tracks/cfml/exercises/word-count/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/word-count/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/word-count/WordCount.cfc +13 -0
- data/tracks/cfml/exercises/word-count/WordCountTest.cfc +55 -0
- data/tracks/cfml/exercises/word-count/box.json +8 -0
- data/tracks/cfml/exercises/word-count/index.cfm +37 -0
- data/tracks/cfml/img/icon.png +0 -0
- data/tracks/cfml/tasks/GenerateTests.cfc +179 -0
- data/tracks/cfml/tasks/ScaffoldExercise.cfc +85 -0
- data/tracks/cfml/tasks/TestAllSolutions.cfc +24 -0
- data/tracks/cfml/tasks/exercise_template/.meta/HINTS.md +0 -0
- data/tracks/cfml/tasks/exercise_template/@@name@@.cfc +13 -0
- data/tracks/cfml/tasks/exercise_template/@@name@@Test.cfc +15 -0
- data/tracks/cfml/tasks/exercise_template/Solution.cfc +6 -0
- data/tracks/cfml/tasks/exercise_template/SolutionTest.cfc +7 -0
- data/tracks/cfml/tasks/exercise_template/TestRunner.cfc +103 -0
- data/tracks/cfml/tasks/exercise_template/box.json +8 -0
- data/tracks/cfml/tasks/exercise_template/index.cfm +37 -0
- data/tracks/coldfusion/docs/ABOUT.md +8 -6
- data/tracks/csharp/docs/GENERATORS.md +7 -0
- data/tracks/csharp/exercises/clock/ClockTest.cs +15 -15
- data/tracks/csharp/exercises/nucleotide-count/Example.cs +10 -11
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCount.cs +2 -7
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCountTest.cs +37 -47
- data/tracks/csharp/exercises/pig-latin/Example.cs +1 -1
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +19 -7
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +7 -1
- data/tracks/csharp/exercises/tournament/Example.cs +1 -1
- data/tracks/csharp/exercises/tournament/TournamentTest.cs +151 -68
- data/tracks/csharp/exercises/triangle/Example.cs +26 -8
- data/tracks/csharp/exercises/triangle/Triangle.cs +16 -1
- data/tracks/csharp/exercises/triangle/TriangleTest.cs +44 -30
- data/tracks/csharp/generators/Exercise.cs +6 -1
- data/tracks/csharp/generators/Exercises/Clock.cs +17 -1
- data/tracks/csharp/generators/Exercises/NucleotideCount.cs +61 -0
- data/tracks/csharp/generators/Exercises/Tournament.cs +66 -0
- data/tracks/csharp/generators/Exercises/Triangle.cs +36 -0
- data/tracks/dart/config.json +15 -2
- data/tracks/dart/exercises/raindrops/lib/example.dart +23 -0
- data/tracks/dart/exercises/raindrops/lib/raindrops.dart +3 -0
- data/tracks/dart/exercises/raindrops/pubspec.lock +281 -0
- data/tracks/dart/exercises/raindrops/pubspec.yaml +3 -0
- data/tracks/dart/exercises/raindrops/test/raindrops_test.dart +94 -0
- data/tracks/delphi/exercises/pig-latin/uPigLatinExample.pas +1 -25
- data/tracks/haskell/config.json +9 -0
- data/tracks/haskell/exercises/acronym/README.md +0 -1
- data/tracks/haskell/exercises/all-your-base/README.md +1 -1
- data/tracks/haskell/exercises/allergies/README.md +0 -1
- data/tracks/haskell/exercises/alphametics/README.md +2 -2
- data/tracks/haskell/exercises/atbash-cipher/README.md +2 -1
- data/tracks/haskell/exercises/beer-song/README.md +1 -1
- data/tracks/haskell/exercises/binary/README.md +2 -0
- data/tracks/haskell/exercises/bowling/README.md +20 -6
- data/tracks/haskell/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/haskell/exercises/connect/README.md +1 -1
- data/tracks/haskell/exercises/crypto-square/README.md +4 -4
- data/tracks/haskell/exercises/diamond/README.md +113 -0
- data/tracks/haskell/exercises/diamond/examples/success-standard/package.yaml +16 -0
- data/tracks/haskell/exercises/diamond/examples/success-standard/src/Diamond.hs +16 -0
- data/tracks/haskell/exercises/diamond/package.yaml +20 -0
- data/tracks/haskell/exercises/diamond/src/Diamond.hs +4 -0
- data/tracks/haskell/exercises/diamond/stack.yaml +1 -0
- data/tracks/haskell/exercises/diamond/test/Tests.hs +109 -0
- data/tracks/haskell/exercises/etl/README.md +3 -1
- data/tracks/haskell/exercises/food-chain/README.md +1 -1
- data/tracks/haskell/exercises/go-counting/README.md +1 -1
- data/tracks/haskell/exercises/grade-school/README.md +0 -1
- data/tracks/haskell/exercises/grains/README.md +0 -1
- data/tracks/haskell/exercises/house/README.md +1 -2
- data/tracks/haskell/exercises/isogram/README.md +2 -1
- data/tracks/haskell/exercises/kindergarten-garden/README.md +3 -3
- data/tracks/haskell/exercises/leap/README.md +1 -1
- data/tracks/haskell/exercises/linked-list/README.md +10 -10
- data/tracks/haskell/exercises/luhn/README.md +7 -7
- data/tracks/haskell/exercises/matrix/README.md +6 -4
- data/tracks/haskell/exercises/meetup/README.md +1 -2
- data/tracks/haskell/exercises/nucleotide-count/README.md +8 -22
- data/tracks/haskell/exercises/ocr-numbers/README.md +6 -6
- data/tracks/haskell/exercises/octal/README.md +6 -2
- data/tracks/haskell/exercises/palindrome-products/README.md +12 -6
- data/tracks/haskell/exercises/pangram/README.md +1 -1
- data/tracks/haskell/exercises/pascals-triangle/README.md +2 -2
- data/tracks/haskell/exercises/phone-number/README.md +3 -2
- data/tracks/haskell/exercises/pov/README.md +3 -3
- data/tracks/haskell/exercises/pythagorean-triplet/README.md +3 -3
- data/tracks/haskell/exercises/queen-attack/README.md +1 -1
- data/tracks/haskell/exercises/rna-transcription/README.md +1 -1
- data/tracks/haskell/exercises/roman-numerals/README.md +1 -1
- data/tracks/haskell/exercises/run-length-encoding/README.md +4 -4
- data/tracks/haskell/exercises/saddle-points/README.md +1 -1
- data/tracks/haskell/exercises/scrabble-score/README.md +3 -1
- data/tracks/haskell/exercises/secret-handshake/README.md +1 -1
- data/tracks/haskell/exercises/sgf-parsing/README.md +4 -4
- data/tracks/haskell/exercises/simple-cipher/README.md +1 -1
- data/tracks/haskell/exercises/spiral-matrix/README.md +2 -2
- data/tracks/haskell/exercises/triangle/README.md +9 -6
- data/tracks/haskell/exercises/trinary/README.md +1 -1
- data/tracks/haskell/exercises/word-count/README.md +1 -2
- data/tracks/haskell/exercises/wordy/README.md +0 -5
- data/tracks/java/config.json +56 -9
- data/tracks/java/exercises/binary-search-tree/src/test/java/BSTTest.java +4 -4
- data/tracks/javascript/exercises/two-bucket/example.js +66 -69
- data/tracks/javascript/exercises/two-bucket/two-bucket.spec.js +18 -18
- data/tracks/julia/config.json +1 -0
- data/tracks/julia/docs/ABOUT.md +3 -8
- data/tracks/prolog/README.md +1 -1
- data/tracks/purescript/.travis.yml +1 -0
- data/tracks/purescript/README.md +9 -0
- data/tracks/purescript/bin/check-bower.sh +42 -0
- data/tracks/purescript/bin/test-separate.sh +46 -0
- data/tracks/python/README.md +2 -2
- data/tracks/python/exercises/all-your-base/all_your_base.py +2 -0
- data/tracks/python/exercises/atbash-cipher/atbash_cipher.py +2 -2
- data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +2 -2
- data/tracks/python/exercises/complex-numbers/example.py +2 -2
- data/tracks/python/exercises/gigasecond/gigasecond.py +1 -1
- data/tracks/python/exercises/hamming/hamming.py +1 -1
- data/tracks/python/exercises/hexadecimal/hexadecimal.py +1 -1
- data/tracks/python/exercises/leap/leap.py +1 -1
- data/tracks/python/exercises/meetup/meetup.py +1 -1
- data/tracks/python/exercises/phone-number/example.py +4 -2
- data/tracks/python/exercises/phone-number/phone_number_test.py +47 -16
- data/tracks/python/exercises/pig-latin/pig_latin.py +1 -1
- data/tracks/python/exercises/scrabble-score/scrabble_score.py +1 -1
- data/tracks/python/exercises/wordy/wordy.py +1 -1
- data/tracks/scala/exercises/meetup/example.scala +29 -10
- data/tracks/scala/exercises/meetup/src/main/scala/Meetup.scala +23 -0
- data/tracks/scala/exercises/meetup/src/test/scala/MeetupTest.scala +273 -183
- data/tracks/sml/config.json +13 -0
- data/tracks/sml/exercises/anagram/README.md +21 -5
- data/tracks/sml/exercises/anagram/anagram.sml +2 -6
- data/tracks/sml/exercises/anagram/example.sml +29 -24
- data/tracks/sml/exercises/anagram/test.sml +56 -50
- data/tracks/sml/exercises/anagram/testlib.sml +159 -0
- data/tracks/sml/exercises/diamond/README.md +89 -0
- data/tracks/sml/exercises/diamond/diamond.sml +2 -0
- data/tracks/sml/exercises/diamond/example.sml +25 -0
- data/tracks/sml/exercises/diamond/test.sml +27 -0
- data/tracks/sml/exercises/diamond/testlib.sml +159 -0
- data/tracks/sml/exercises/raindrops/raindrops.sml +2 -2
- data/tracks/sml/exercises/raindrops/test.sml +66 -95
- data/tracks/sml/exercises/raindrops/testlib.sml +159 -0
- metadata +265 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Diamond
|
|
2
|
+
|
|
3
|
+
The diamond kata takes as its input a letter, and outputs it in a diamond
|
|
4
|
+
shape. Given a letter, it prints a diamond starting with 'A', with the
|
|
5
|
+
supplied letter at the widest point.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
* The first row contains one 'A'.
|
|
10
|
+
* The last row contains one 'A'.
|
|
11
|
+
* All rows, except the first and last, have exactly two identical letters.
|
|
12
|
+
* All rows have as many trailing spaces as leading spaces. (This might be 0).
|
|
13
|
+
* The diamond is horizontally symmetric.
|
|
14
|
+
* The diamond is vertically symmetric.
|
|
15
|
+
* The diamond has a square shape (width equals height).
|
|
16
|
+
* The letters form a diamond shape.
|
|
17
|
+
* The top half has the letters in ascending order.
|
|
18
|
+
* The bottom half has the letters in descending order.
|
|
19
|
+
* The four corners (containing the spaces) are triangles.
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
In the following examples, spaces are indicated by `·` characters.
|
|
24
|
+
|
|
25
|
+
Diamond for letter 'A':
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
A
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Diamond for letter 'C':
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
··A··
|
|
35
|
+
·B·B·
|
|
36
|
+
C···C
|
|
37
|
+
·B·B·
|
|
38
|
+
··A··
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Diamond for letter 'E':
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
····A····
|
|
45
|
+
···B·B···
|
|
46
|
+
··C···C··
|
|
47
|
+
·D·····D·
|
|
48
|
+
E·······E
|
|
49
|
+
·D·····D·
|
|
50
|
+
··C···C··
|
|
51
|
+
···B·B···
|
|
52
|
+
····A····
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Getting Started
|
|
57
|
+
|
|
58
|
+
For installation and learning resources, refer to the
|
|
59
|
+
[exercism help page](http://exercism.io/languages/haskell).
|
|
60
|
+
|
|
61
|
+
## Running the tests
|
|
62
|
+
|
|
63
|
+
To run the test suite, execute the following command:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
stack test
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### If you get an error message like this...
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
No .cabal file found in directory
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
You are probably running an old stack version and need
|
|
76
|
+
to upgrade it.
|
|
77
|
+
|
|
78
|
+
#### Otherwise, if you get an error message like this...
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
No compiler found, expected minor version match with...
|
|
82
|
+
Try running "stack setup" to install the correct GHC...
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Just do as it says and it will download and install
|
|
86
|
+
the correct compiler version:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
stack setup
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Running *GHCi*
|
|
93
|
+
|
|
94
|
+
If you want to play with your solution in GHCi, just run the command:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
stack ghci
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Feedback, Issues, Pull Requests
|
|
101
|
+
|
|
102
|
+
The [exercism/haskell](https://github.com/exercism/haskell) repository on
|
|
103
|
+
GitHub is the home for all of the Haskell exercises.
|
|
104
|
+
|
|
105
|
+
If you have feedback about an exercise, or want to help implementing a new
|
|
106
|
+
one, head over there and create an issue. We'll do our best to help you!
|
|
107
|
+
|
|
108
|
+
## Source
|
|
109
|
+
|
|
110
|
+
Seb Rose [http://claysnow.co.uk/recycling-tests-in-tdd/](http://claysnow.co.uk/recycling-tests-in-tdd/)
|
|
111
|
+
|
|
112
|
+
## Submitting Incomplete Solutions
|
|
113
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module Diamond (diamond) where
|
|
2
|
+
|
|
3
|
+
import Data.Char (ord, chr)
|
|
4
|
+
|
|
5
|
+
pad :: Int -> String
|
|
6
|
+
pad x = replicate x ' '
|
|
7
|
+
|
|
8
|
+
oneRow :: Char -> (Int, Int) -> String
|
|
9
|
+
oneRow c (0, y) = pad y ++ [c] ++ pad y
|
|
10
|
+
oneRow c (x, y) = pad y ++ [c] ++ pad x ++ [c] ++ pad y
|
|
11
|
+
|
|
12
|
+
diamond :: Char -> [String]
|
|
13
|
+
diamond = (\x -> x ++ tail (reverse x)) . mkTop . subtract 64 . ord
|
|
14
|
+
where rows x = zip (0 : take (x-1) [1, 3..]) [x-1, x-2..0]
|
|
15
|
+
mkTop = zipWith oneRow abc . rows
|
|
16
|
+
abc = map chr [65..90]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: diamond
|
|
2
|
+
version: 1.0.0.1
|
|
3
|
+
|
|
4
|
+
dependencies:
|
|
5
|
+
- base
|
|
6
|
+
|
|
7
|
+
library:
|
|
8
|
+
exposed-modules: Diamond
|
|
9
|
+
source-dirs: src
|
|
10
|
+
dependencies:
|
|
11
|
+
# - foo # List here the packages you
|
|
12
|
+
# - bar # want to use in your solution.
|
|
13
|
+
|
|
14
|
+
tests:
|
|
15
|
+
test:
|
|
16
|
+
main: Tests.hs
|
|
17
|
+
source-dirs: test
|
|
18
|
+
dependencies:
|
|
19
|
+
- diamond
|
|
20
|
+
- hspec
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
resolver: lts-8.21
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{-# LANGUAGE RecordWildCards #-}
|
|
2
|
+
|
|
3
|
+
import Data.Foldable (for_)
|
|
4
|
+
import Test.Hspec (Spec, describe, it, shouldBe)
|
|
5
|
+
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
|
|
6
|
+
import Diamond (diamond)
|
|
7
|
+
|
|
8
|
+
main :: IO ()
|
|
9
|
+
main = hspecWith defaultConfig {configFastFail = True} specs
|
|
10
|
+
|
|
11
|
+
specs :: Spec
|
|
12
|
+
specs = describe "diamond" $ for_ cases test
|
|
13
|
+
where
|
|
14
|
+
|
|
15
|
+
test Case{..} = it description assertion
|
|
16
|
+
where
|
|
17
|
+
assertion = diamond input `shouldBe` expected
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
data Case = Case { description :: String
|
|
21
|
+
, input :: Char
|
|
22
|
+
, expected :: [String]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
cases :: [Case]
|
|
26
|
+
cases = [ Case { description = "Degenerate case with a single 'A' row"
|
|
27
|
+
, input = 'A'
|
|
28
|
+
, expected = ["A"]
|
|
29
|
+
}
|
|
30
|
+
, Case { description = "Degenerate case with no row containing 3 distinct groups of spaces"
|
|
31
|
+
, input = 'B'
|
|
32
|
+
, expected = [" A ",
|
|
33
|
+
"B B",
|
|
34
|
+
" A "]
|
|
35
|
+
}
|
|
36
|
+
, Case { description = "Smallest non-degenerate case with odd diamond side length"
|
|
37
|
+
, input = 'C'
|
|
38
|
+
, expected = [" A ",
|
|
39
|
+
" B B ",
|
|
40
|
+
"C C",
|
|
41
|
+
" B B ",
|
|
42
|
+
" A "]
|
|
43
|
+
}
|
|
44
|
+
, Case { description = "Smallest non-degenerate case with even diamond side length"
|
|
45
|
+
, input = 'D'
|
|
46
|
+
, expected = [" A ",
|
|
47
|
+
" B B ",
|
|
48
|
+
" C C ",
|
|
49
|
+
"D D",
|
|
50
|
+
" C C ",
|
|
51
|
+
" B B ",
|
|
52
|
+
" A "]
|
|
53
|
+
}
|
|
54
|
+
, Case { description = "Largest possible diamond"
|
|
55
|
+
, input = 'Z'
|
|
56
|
+
, expected = [
|
|
57
|
+
" A ",
|
|
58
|
+
" B B ",
|
|
59
|
+
" C C ",
|
|
60
|
+
" D D ",
|
|
61
|
+
" E E ",
|
|
62
|
+
" F F ",
|
|
63
|
+
" G G ",
|
|
64
|
+
" H H ",
|
|
65
|
+
" I I ",
|
|
66
|
+
" J J ",
|
|
67
|
+
" K K ",
|
|
68
|
+
" L L ",
|
|
69
|
+
" M M ",
|
|
70
|
+
" N N ",
|
|
71
|
+
" O O ",
|
|
72
|
+
" P P ",
|
|
73
|
+
" Q Q ",
|
|
74
|
+
" R R ",
|
|
75
|
+
" S S ",
|
|
76
|
+
" T T ",
|
|
77
|
+
" U U ",
|
|
78
|
+
" V V ",
|
|
79
|
+
" W W ",
|
|
80
|
+
" X X ",
|
|
81
|
+
" Y Y ",
|
|
82
|
+
"Z Z",
|
|
83
|
+
" Y Y ",
|
|
84
|
+
" X X ",
|
|
85
|
+
" W W ",
|
|
86
|
+
" V V ",
|
|
87
|
+
" U U ",
|
|
88
|
+
" T T ",
|
|
89
|
+
" S S ",
|
|
90
|
+
" R R ",
|
|
91
|
+
" Q Q ",
|
|
92
|
+
" P P ",
|
|
93
|
+
" O O ",
|
|
94
|
+
" N N ",
|
|
95
|
+
" M M ",
|
|
96
|
+
" L L ",
|
|
97
|
+
" K K ",
|
|
98
|
+
" J J ",
|
|
99
|
+
" I I ",
|
|
100
|
+
" H H ",
|
|
101
|
+
" G G ",
|
|
102
|
+
" F F ",
|
|
103
|
+
" E E ",
|
|
104
|
+
" D D ",
|
|
105
|
+
" C C ",
|
|
106
|
+
" B B ",
|
|
107
|
+
" A "]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ETL
|
|
2
2
|
|
|
3
3
|
We are going to do the `Transform` step of an Extract-Transform-Load.
|
|
4
4
|
|
|
5
5
|
### ETL
|
|
6
|
+
|
|
6
7
|
Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
|
|
7
8
|
we're going to migrate this."
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ once." That's then typically followed by much forehead slapping and
|
|
|
11
12
|
moaning about how stupid we could possibly be.)
|
|
12
13
|
|
|
13
14
|
### The goal
|
|
15
|
+
|
|
14
16
|
We're going to extract some scrabble scores from a legacy system.
|
|
15
17
|
|
|
16
18
|
The old system stored a list of letters per score:
|
|
@@ -16,7 +16,7 @@ only horizontal and vertical neighbours count. In the following diagram
|
|
|
16
16
|
the stones which matter are marked "O" and the stones that don't are
|
|
17
17
|
marked "I" (ignored). Empty spaces represent empty intersections.
|
|
18
18
|
|
|
19
|
-
```
|
|
19
|
+
```text
|
|
20
20
|
+----+
|
|
21
21
|
|IOOI|
|
|
22
22
|
|O O|
|
|
@@ -11,10 +11,9 @@ Output the nursery rhyme 'This is the House that Jack Built'.
|
|
|
11
11
|
|
|
12
12
|
- [papyr.com](http://papyr.com/hypertextbooks/grammar/ph_noun.htm)
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
The nursery rhyme reads as follows:
|
|
16
15
|
|
|
17
|
-
```
|
|
16
|
+
```text
|
|
18
17
|
This is the house that Jack built.
|
|
19
18
|
|
|
20
19
|
This is the malt
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Determine if a word or phrase is an isogram.
|
|
4
4
|
|
|
5
|
-
An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
|
|
5
|
+
An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter, however spaces and hyphens are allowed to appear multiple times.
|
|
6
6
|
|
|
7
7
|
Examples of isograms:
|
|
8
8
|
|
|
9
9
|
- lumberjacks
|
|
10
10
|
- background
|
|
11
11
|
- downstream
|
|
12
|
+
- six-year-old
|
|
12
13
|
|
|
13
14
|
The word *isograms*, however, is not an isogram, because the s repeats.
|
|
14
15
|
|
|
@@ -13,7 +13,7 @@ To this end, they've put little styrofoam cups along the window sills,
|
|
|
13
13
|
and planted one type of plant in each cup, choosing randomly from the
|
|
14
14
|
available types of seeds.
|
|
15
15
|
|
|
16
|
-
```
|
|
16
|
+
```text
|
|
17
17
|
[window][window][window]
|
|
18
18
|
........................ # each dot represents a styrofoam cup
|
|
19
19
|
........................
|
|
@@ -30,7 +30,7 @@ cups in alphabetical order.
|
|
|
30
30
|
|
|
31
31
|
The following diagram represents Alice's plants:
|
|
32
32
|
|
|
33
|
-
```
|
|
33
|
+
```text
|
|
34
34
|
[window][window][window]
|
|
35
35
|
VR......................
|
|
36
36
|
RG......................
|
|
@@ -45,7 +45,7 @@ which plants belong to which students.
|
|
|
45
45
|
|
|
46
46
|
For example, if it's told that the garden looks like so:
|
|
47
47
|
|
|
48
|
-
```
|
|
48
|
+
```text
|
|
49
49
|
[window][window][window]
|
|
50
50
|
VRCGVVRVCGGCCGVRGCVCGCGV
|
|
51
51
|
VRCCCGCRRGVCGCRVVCVGCGCV
|
|
@@ -4,7 +4,7 @@ Given a year, report if it is a leap year.
|
|
|
4
4
|
|
|
5
5
|
The tricky thing here is that a leap year in the Gregorian calendar occurs:
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```text
|
|
8
8
|
on every year that is evenly divisible by 4
|
|
9
9
|
except every year that is evenly divisible by 100
|
|
10
10
|
unless the year is also evenly divisible by 400
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Implement a doubly linked list.
|
|
4
4
|
|
|
5
|
-
Like an array, a linked list is a simple linear data structure. Several
|
|
6
|
-
common data types can be implemented using linked lists, like queues,
|
|
5
|
+
Like an array, a linked list is a simple linear data structure. Several
|
|
6
|
+
common data types can be implemented using linked lists, like queues,
|
|
7
7
|
stacks, and associative arrays.
|
|
8
8
|
|
|
9
|
-
A linked list is a collection of data elements called *nodes*. In a
|
|
10
|
-
*singly linked list* each node holds a value and a link to the next node.
|
|
11
|
-
In a *doubly linked list* each node also holds a link to the previous
|
|
9
|
+
A linked list is a collection of data elements called *nodes*. In a
|
|
10
|
+
*singly linked list* each node holds a value and a link to the next node.
|
|
11
|
+
In a *doubly linked list* each node also holds a link to the previous
|
|
12
12
|
node.
|
|
13
13
|
|
|
14
|
-
You will write an implementation of a doubly linked list. Implement a
|
|
15
|
-
Node to hold a value and pointers to the next and previous nodes. Then
|
|
16
|
-
implement a List which holds references to the first and last node and
|
|
14
|
+
You will write an implementation of a doubly linked list. Implement a
|
|
15
|
+
Node to hold a value and pointers to the next and previous nodes. Then
|
|
16
|
+
implement a List which holds references to the first and last node and
|
|
17
17
|
offers an array-like interface for adding and removing items:
|
|
18
18
|
|
|
19
19
|
* `push` (*insert value at back*);
|
|
@@ -21,8 +21,8 @@ offers an array-like interface for adding and removing items:
|
|
|
21
21
|
* `shift` (*remove value at front*).
|
|
22
22
|
* `unshift` (*insert value at front*);
|
|
23
23
|
|
|
24
|
-
To keep your implementation simple, the tests will not cover error
|
|
25
|
-
conditions. Specifically: `pop` or `shift` will never be called on an
|
|
24
|
+
To keep your implementation simple, the tests will not cover error
|
|
25
|
+
conditions. Specifically: `pop` or `shift` will never be called on an
|
|
26
26
|
empty list.
|
|
27
27
|
|
|
28
28
|
If you want to know more about linked lists, check [Wikipedia](https://en.wikipedia.org/wiki/Linked_list).
|
|
@@ -18,27 +18,27 @@ are disallowed.
|
|
|
18
18
|
|
|
19
19
|
## Example 1: valid credit card number
|
|
20
20
|
|
|
21
|
-
```
|
|
21
|
+
```text
|
|
22
22
|
4539 1488 0343 6467
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
The first step of the Luhn algorithm is to double every second digit,
|
|
26
26
|
starting from the right. We will be doubling
|
|
27
27
|
|
|
28
|
-
```
|
|
28
|
+
```text
|
|
29
29
|
4_3_ 1_8_ 0_4_ 6_6_
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
If doubling the number results in a number greater than 9 then subtract 9
|
|
33
33
|
from the product. The results of our doubling:
|
|
34
34
|
|
|
35
|
-
```
|
|
35
|
+
```text
|
|
36
36
|
8569 2478 0383 3437
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
Then sum all of the digits:
|
|
40
40
|
|
|
41
|
-
```
|
|
41
|
+
```text
|
|
42
42
|
8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -46,19 +46,19 @@ If the sum is evenly divisible by 10, then the number is valid. This number is v
|
|
|
46
46
|
|
|
47
47
|
## Example 2: invalid credit card number
|
|
48
48
|
|
|
49
|
-
```
|
|
49
|
+
```text
|
|
50
50
|
8273 1232 7352 0569
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Double the second digits, starting from the right
|
|
54
54
|
|
|
55
|
-
```
|
|
55
|
+
```text
|
|
56
56
|
7253 2262 5312 0539
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
Sum the digits
|
|
60
60
|
|
|
61
|
-
```
|
|
61
|
+
```text
|
|
62
62
|
7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
|
|
63
63
|
```
|
|
64
64
|
|
|
@@ -18,10 +18,9 @@ end in '-teenth'. Therefore, one is guaranteed that each day of the week
|
|
|
18
18
|
(Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
|
|
19
19
|
in every month.
|
|
20
20
|
|
|
21
|
-
Given examples of a meetup dates, each containing a month, day, year, and descriptor
|
|
21
|
+
Given examples of a meetup dates, each containing a month, day, year, and descriptor
|
|
22
22
|
(first, second, teenth, etc), calculate the date of the actual meetup.
|
|
23
23
|
For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
|
|
24
|
-
|
|
25
24
|
|
|
26
25
|
## Hints
|
|
27
26
|
|
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
# Nucleotide Count
|
|
2
2
|
|
|
3
|
-
Given a DNA string, compute how many times each nucleotide occurs in the string.
|
|
3
|
+
Given a single stranded DNA string, compute how many times each nucleotide occurs in the string.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Each symbol represents a nucleotide, which is a fancy name for the
|
|
9
|
-
particular molecules that happen to make up a large part of DNA.
|
|
10
|
-
|
|
11
|
-
Shortest intro to biochemistry EVAR:
|
|
5
|
+
The genetic language of every living thing on the planet is DNA.
|
|
6
|
+
DNA is a large molecule that is built from an extremely long sequence of individual elements called nucleotides.
|
|
7
|
+
4 types exist in DNA and these differ only slightly and can be represented as the following symbols: 'A' for adenine, 'C' for cytosine, 'G' for guanine, and 'T' thymine.
|
|
12
8
|
|
|
9
|
+
Here is an analogy:
|
|
13
10
|
- twigs are to birds nests as
|
|
14
|
-
- nucleotides are to DNA
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- oh crap lipids
|
|
18
|
-
|
|
19
|
-
I'm not going to talk about lipids because they're crazy complex.
|
|
20
|
-
|
|
21
|
-
So back to nucleotides.
|
|
22
|
-
|
|
23
|
-
DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine
|
|
24
|
-
(`G`), and thymine (`T`).
|
|
25
|
-
|
|
26
|
-
RNA contains a slightly different set of nucleotides, but we don't care
|
|
27
|
-
about that for now.
|
|
11
|
+
- nucleotides are to DNA as
|
|
12
|
+
- legos are to lego houses as
|
|
13
|
+
- words are to sentences as...
|
|
28
14
|
|
|
29
15
|
|
|
30
16
|
## Getting Started
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OCR Numbers
|
|
2
2
|
|
|
3
3
|
Given a 3 x 4 grid of pipes, underscores, and spaces, determine which number is
|
|
4
4
|
represented, or whether it is garbled.
|
|
@@ -9,7 +9,7 @@ To begin with, convert a simple binary font to a string containing 0 or 1.
|
|
|
9
9
|
|
|
10
10
|
The binary font uses pipes and underscores, four rows high and three columns wide.
|
|
11
11
|
|
|
12
|
-
```
|
|
12
|
+
```text
|
|
13
13
|
_ #
|
|
14
14
|
| | # zero.
|
|
15
15
|
|_| #
|
|
@@ -18,7 +18,7 @@ The binary font uses pipes and underscores, four rows high and three columns wid
|
|
|
18
18
|
|
|
19
19
|
Is converted to "0"
|
|
20
20
|
|
|
21
|
-
```
|
|
21
|
+
```text
|
|
22
22
|
#
|
|
23
23
|
| # one.
|
|
24
24
|
| #
|
|
@@ -39,7 +39,7 @@ Update your program to recognize multi-character binary strings, replacing garbl
|
|
|
39
39
|
|
|
40
40
|
Update your program to recognize all numbers 0 through 9, both individually and as part of a larger string.
|
|
41
41
|
|
|
42
|
-
```
|
|
42
|
+
```text
|
|
43
43
|
_
|
|
44
44
|
_|
|
|
45
45
|
|_
|
|
@@ -48,7 +48,7 @@ Update your program to recognize all numbers 0 through 9, both individually and
|
|
|
48
48
|
|
|
49
49
|
Is converted to "2"
|
|
50
50
|
|
|
51
|
-
```
|
|
51
|
+
```text
|
|
52
52
|
_ _ _ _ _ _ _ _ #
|
|
53
53
|
| _| _||_||_ |_ ||_||_|| | # decimal numbers.
|
|
54
54
|
||_ _| | _||_| ||_| _||_| #
|
|
@@ -61,7 +61,7 @@ Is converted to "1234567890"
|
|
|
61
61
|
|
|
62
62
|
Update your program to handle multiple numbers, one per line. When converting several lines, join the lines with commas.
|
|
63
63
|
|
|
64
|
-
```
|
|
64
|
+
```text
|
|
65
65
|
_ _
|
|
66
66
|
| _| _|
|
|
67
67
|
||_ _|
|
|
@@ -8,11 +8,13 @@ Implement octal to decimal conversion. Given an octal input
|
|
|
8
8
|
string, your program should produce a decimal output.
|
|
9
9
|
|
|
10
10
|
## Note
|
|
11
|
+
|
|
11
12
|
- Implement the conversion yourself.
|
|
12
13
|
Do not use something else to perform the conversion for you.
|
|
13
14
|
- Treat invalid input as octal 0.
|
|
14
15
|
|
|
15
16
|
## About Octal (Base-8)
|
|
17
|
+
|
|
16
18
|
Decimal is a base-10 system.
|
|
17
19
|
|
|
18
20
|
A number 233 in base 10 notation can be understood
|
|
@@ -25,7 +27,8 @@ as a linear combination of powers of 10:
|
|
|
25
27
|
- All these values are summed.
|
|
26
28
|
|
|
27
29
|
So:
|
|
28
|
-
|
|
30
|
+
|
|
31
|
+
```text
|
|
29
32
|
233 # decimal
|
|
30
33
|
= 2*10^2 + 3*10^1 + 3*10^0
|
|
31
34
|
= 2*100 + 3*10 + 3*1
|
|
@@ -34,7 +37,8 @@ So:
|
|
|
34
37
|
Octal is similar, but uses powers of 8 rather than powers of 10.
|
|
35
38
|
|
|
36
39
|
So:
|
|
37
|
-
|
|
40
|
+
|
|
41
|
+
```text
|
|
38
42
|
233 # octal
|
|
39
43
|
= 2*8^2 + 3*8^1 + 3*8^0
|
|
40
44
|
= 2*64 + 3*8 + 3*1
|