Skip to content

Instantly share code, notes, and snippets.

@rossmurray
Last active August 29, 2015 14:04
Show Gist options
  • Save rossmurray/790b3b5e3b31857978cb to your computer and use it in GitHub Desktop.
Save rossmurray/790b3b5e3b31857978cb to your computer and use it in GitHub Desktop.
FizzBuzz
public IList<string> Solve(int n)
{
return Enumerable.Range(1, n).Select(x =>
x % 15 == 0 ? "FizzBuzz"
: x % 5 == 0 ? "Buzz"
: x % 3 == 0 ? "Fizz"
: x.ToString()
).ToArray();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment