Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JL-Cox/a230e20245055fd2298c29e2cf8ad75d to your computer and use it in GitHub Desktop.
Save JL-Cox/a230e20245055fd2298c29e2cf8ad75d to your computer and use it in GitHub Desktop.
CodeWarsKata: Factorial Decomposition
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeWarsKata_FactorialDecomposition_06262018
{
class Program
{
static void Main(string[] args)
{
Decomp(6);
}
public static string Decomp(int n)
{
string answer = "";
int[] factorialArr = new int[n];
for (int i = 1; i <= n; i++)
{
factorialArr[i - 1] = i;
}
foreach (var item in factorialArr)
{
Console.Write(item);
}
Console.WriteLine($"Answer: {answer}");
Console.ReadKey();
return answer;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment