5 ms·
Login seems borked, but here's my Perl at 59 chars (141 points): print(($_%3?"":"Fizz").($_%5?"":"Buzz")||$_,"\n")for 1..100
by GregBuchholz 14y ago
Login seems borked, but here's my Perl at 59 chars (141 points):
print(($_%3?"":"Fizz").($_%5?"":"Buzz")||$_,"\n")for 1..100
- rvivek 14y agoWhat happens on login?
- GregBuchholz 14y agoI tried the github option, and the first time I tried, it barfed about "unauthorized credentials" or some such after the redirect back from github, bringing me to another hackerrank login page. I tried it again, and it choked right away with the same message. Third time and it asks to "Confirm Submission", but hung after hitting yes.
- colomon 14y agoNice! Much better than my first stab. Slightly shorter (56 chars) P6 version: say(("Fizz" if $_%%3)~("Buzz" if $_%%5)||$_) for 1..100
- hercynium 14y agoThis is highly amusing to me because my solution was almost exactly identical (and the same number of keystrokes: print(($_%3?"":"Fizz").($_%5?"":"Buzz")or$_,"\n")for 1..100 sadly, though it says they're running perl 5.14, it wouldn't work with 'say' which would have shaved off 7 characters. edit: Guess what? The code above does not work. It's what I typed into my buffer, and then fixed it on the console to use || instead of or. Oh operator precedence!