Skip to content

Instantly share code, notes, and snippets.

@profesor79
Created March 22, 2023 16:09
Show Gist options
  • Save profesor79/cdab87d9d7e51f3fceffe8ab86413c51 to your computer and use it in GitHub Desktop.
Save profesor79/cdab87d9d7e51f3fceffe8ab86413c51 to your computer and use it in GitHub Desktop.
no if no IF it is possible
public class _null
{
private static string[] _dividers3 = new string[] { "f", string.Empty, string.Empty };
private static string[] _dividers5 = new string[] { "bu", string.Empty, string.Empty, string.Empty, string.Empty };
private static string[] _results = new string[] { "", "fizz", "buzz", "fizzbuzz" };
public string FizzBuzz(int i)
{
_results[0] = i.ToString();
return _results[(_dividers3[i % 3] + _dividers5[i % 5]).Length];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment