Skip to content

Commit 98f89c2

Browse files
committed
Restore Fibonacci
1 parent 89969f5 commit 98f89c2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

fibonacci/csharp/code.cs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
public static class Code
22
{
3-
public static int Fibonacci(int n)
4-
{
5-
return n switch
6-
{
7-
<= 1 => n,
8-
_ => Fibonacci(n - 1) + Fibonacci(n - 2)
9-
};
10-
}
3+
public static int Fibonacci(int n) =>
4+
n <= 1 ? n : Fibonacci(n - 1) + Fibonacci(n - 2);
115
}

0 commit comments

Comments
 (0)