6 kyu

FizzBuzz Backwards

571 of 1,109marbiru
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Velby Avatar

    Wouldn't this be more interesting if the array didn't always start at 1?

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • ejini战神 Avatar
    • Node 18 should be enabled (Refer this and this for more info)
  • user9644768 Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • willfowls Avatar

    i'm familiar with regular fizz buzz.

    it doesn't make sense to me why in [1, "Fizz", "Buzz", "Fizz", 5, "FizzBuzz"] ==> [2, 3], 2 is "Fizz", while in the next example given, [1, "FizzBuzz", 3, "FizzBuzz", 5, "FizzBuzz"] ==> [2, 2], 2 is FizzBuzz.

    the way the problem reads to me is that multiples of 2 are "Fizz", multiples of 3 are "Buzz", multiples of both are "FizzBuzz".

    may someone please clarify?

  • anter69 Avatar

    Ruby translation kumited -- please check and approve

  • htt-pete Avatar

    In your description you state to find the numbers whose multiples are being replaced by Fizz and Buzz. But one of the sample tests is Test.assertDeepEquals(reverseFizzBuzz([1,"FizzBuzz",3,"FizzBuzz",5,"FizzBuzz"]), [2,2]), I would expect the result too be [0, 0] as neither Fizz or Buzz are present in the array.

    Is the description incorrect or is it the tests?

  • ZozoFouchtra Avatar
  • Voile Avatar

    Approved

  • rsdah13 Avatar

    It's not obvious why every answer should have two indicies. For example, it seems counter-intuitive that reverseFizzBuzz([1,"Fizz","Buzz","Fizz",5,"FizzBuzz"]) ==> [2,3] while reverseFizzBuzz(["Fizz","Fizz","Fizz","Fizz","Fizz","FizzBuzz"]) ==> [1,6]. In the second case, 6 is a multiple of 1...

  • marbiru Avatar

    Still quite new to coding and was wondering: is there a better format to request answers in than an array of two numbers? Ideally I feel like the format should be something like { fizz:"", buzz:""} so that it's clear what the numbers mean, but is there a convenient way to do that which will be easy for users to interact with?