6 kyu
FizzBuzz Backwards
571 of 1,109marbiru
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Wouldn't this be more interesting if the array didn't always start at 1?
python new test framework is required. updated in this fork
Approved
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)
Enabled in this fork
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?
Maybe not familiar enough :P
Why 2 and why 3 ? They're not static numbers, and your task is to find out what they are.
The answer should read as: elements divisible by 2 are 'Fizz' and elements divisible by 3 are 'Buzz', and divisible by both are 'FizzBuzz', giving the initial input.
lol i guess so, divisible is what i meant by multiples and still doesn't make sense but i'll bookmark for later
got it thanks
Closing the question. Feel free to reply if something still isn't clear.
Ruby translation kumited -- please check and approve
approved after 2 years :)
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?
In this case numbers to be replaced by "Fizz" are multiples of
2
, and numbers to be replaced by "Buzz" are also multiples of2
, so each multiples of2
are then replaced by "FizzBuzz" (ie "Fizz"+"Buzz") like it's usual to do playing FizzBuzzHope it helps.
; ) )
yeah, I was definitely assuming familiarity with regular FizzBuzz -- I could add extra description at the end for those who don't know it I suppose
Python translation kumited.
; ) )
fantastic, thank-ku very much
Approved
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...
I'm sorry, you've lost me -- the first index is the number whose multiples is replaced by Fizz, the second index is the number whose multiples are replaced by Buzz. Is there some way I can make that clearer?
@rsdah13, have made some updates to the description, let me know if that's clearer for you! Thanks for your help
Not a issue.
Nobody mentioned that the two indices has to be coprime.
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?
No, not really.
Either an array of two numbers (a tuple really, but JS doesn't have that exactly) or an object will do just fine.
Cool, thanks!