Carey Brown wrote:This is an aside, but quite often this algorithm is written this way
I usually write it this way. Does it make any difference?
Hi,
this helped a lot, thank you. I have now changed it to this:
Although it now returns the expected results (good first step), as follows:
{11=1, Fizz=4, 14=1, 16=1, 17=1, 19=1, Buzz=3, Lucky=2, FizzBuzz=1, 1=1, 2=1, 4=1, 7=1, 8=1}
I would like to look like the following:
Fizz: 4 Buzz: 3 fizzbuzz: 1 lucky: 2 integer: 10
I also noticed that my implementation was incorrect as multiple of 3 should return : "Fizz", multiple of 5: "Buzz", multiples of 15: "FizzBuzz" and numbers including "3" should output 3. Here is hopefully the correct implementation:
I am struggling to see how to count all integer occurrences such that I get integer: 10
Thanks!