Instructions
Thank you for accepting the challenge. Please read carefully the statement and instructions below and if you have any questions contact us. Feel free to use a programming language and tools (libraries, frameworks, etc.) that make you feel more comfortable, so that we can see your best qualities.
This exercise is not particularly difficult and should not take more than 30 minutes to complete.
What we like to see:
Simplicity – Problems must be solved by taking into account their requirements. Do not use unnecessary abstractions, patterns, and architectural features to solve the problem.
Self-explanatory code – The code must be written in a coherent way (syntax) and so that no comments are needed to explain its operation.
Tests – Use of unit tests using TDD and excellent coverage.
Statement
Write a program that returns the following to a contiguous sequence of numbers:
- Whenever a number multiple of 3 occurs or contains 3 in its representation, it should be replaced by the word “fizz”;
- If it is a multiple of 5, or it contains 5 in its representation, it should be changed to “buzz”;
- If it is a multiple of 3 and 5 it should be changed to “fizzbuzz”;
- If both rule 1 or rule 2 and rule 3 are checked at the same time, it should be changed to “lucky”;
- Rules 1 and 2 are cumulative. Example: 3 should be changed to “fizz fizz”.
Example: Numbers from 1 to 20; Return:
1, 2, “fizz fizz”, 4, “buzz buzz”, “fizz”, 7,8, “fizz”, “buzz”, 11, “fizz”, “fizz”, 14, “lucky”, 16, 17,” fizz “, 19,” buzz ”
Delivery
Send us a link to a Git repository, with a small readme explaining how to execute the algorithm and the tests.
Good luck!