diff --git a/csharp/55-Jump-Game.cs b/csharp/55-Jump-Game.cs new file mode 100644 index 000000000..476aa0107 --- /dev/null +++ b/csharp/55-Jump-Game.cs @@ -0,0 +1,14 @@ +public class Solution { + public bool CanJump(int[] nums) { + int goal = nums.Length - 1; + for (int i = nums.Length-1; i>=0; i--) + { + if (nums[i] + i >= goal) + { + goal = i; + } + } + + return goal == 0 ; + } +}