GitHub PushEvent at 2014-02-17 07:16:09
Repository: CodeEval
Actor: riddhik84
Payload: {"shas":[["3d540edd6052c8cd9c31d7baa13ea637a6f72c7f","ebb93736adc060fc801ffde203ffbffa8d643a49@gmail.com","Create fizzbuzz.java\n\nFIZZ BUZZ\r\nCHALLENGE DESCRIPTION:\r\n\r\nPlayers generally sit in a circle. The player designated to go first says the number \"1\", and each player thenceforth counts one number in turn. However, any number divisible by 'A' e.g. three is replaced by the word fizz and any divisible by 'B' e.g. five by the word buzz. Numbers divisible by both become fizz buzz. A player who hesitates or makes a mistake is either eliminated. \r\n\r\nWrite a program that prints out the the pattern generated by such a scenario given the values of 'A'/'B' and 'N' which are read from an input text file. The input text file contains three space delimited numbers i.e. A, B, N. The program should then print out the final series of numbers using 'F' for fizz, 'B' for 'buzz' and 'FB' for fizz buzz.\r\n\r\nINPUT SAMPLE:\r\n\r\nYour program should read an input file (provided on the command line) which contains multiple newline separated lines. Each line will contain 3 numbers which are space delimited. The first number is first number to divide by ('A' in this example), the second number is the second number to divide by ('B' in this example) and the third number is where you should count till ('N' in this example). You may assume that the input file is formatted correctly and is the numbers are valid positive integers. E.g.\r\n\r\n\r\n1\r\n2\r\n3 5 10\r\n2 7 15\r\nOUTPUT SAMPLE:\r\n\r\nPrint out the series 1 through N replacing numbers divisible by 'A' by F, numbers divisible by 'B' by B and numbers divisible by both as 'FB'. Since the input file contains multiple sets of values, your output will print out one line per set. Ensure that there are no trailing empty spaces on each line you print. E.g.\r\n\r\n\r\n1\r\n2\r\n1 2 F 4 B F 7 8 F B\r\n1 F 3 F 5 F B F 9 F 11 F 13 FB 15\r\nConstraints: \r\nThe number of test cases <= 20 \r\n\"A\" is in range [1, 20] \r\n\"B\" is in range [1, 20] \r\n\"N\" is in range [21, 100]\r\n\r\nSubmit your solution in a file (some file name).(py2| c| cpp| java| rb| pl| php| tcl| clj| js| scala| cs| m| py3| hs| go| bash| lua) or use the online editor.","riddhik84",true]],"size":1,"ref":"refs/heads/Easy","head":"3d540edd6052c8cd9c31d7baa13ea637a6f72c7f"}