File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -192,12 +192,14 @@ function dfs(node) {
192
192
193
193
## C#
194
194
``` c#
195
- public class Solution {
195
+ public class Solution
196
+ {
196
197
IList <IList <int >> paths = new List <IList <int >>();
197
198
IList <int > path = new List <int >();
198
199
int [][] graph ;
199
200
200
- public IList <IList <int >> AllPathsSourceTarget (int [][] graph ) {
201
+ public IList <IList <int >> AllPathsSourceTarget (int [][] graph )
202
+ {
201
203
this .graph = graph ;
202
204
path .Add (0 );
203
205
@@ -206,13 +208,16 @@ public class Solution {
206
208
return paths ;
207
209
}
208
210
209
- void dfs (int node ) {
210
- if (node == graph .Length - 1 ) {
211
+ void dfs (int node )
212
+ {
213
+ if (node == graph .Length - 1 )
214
+ {
211
215
paths .Add (path .ToList ());
212
216
return ;
213
217
}
214
218
215
- foreach (int targetNode in graph [node ]) {
219
+ foreach (int targetNode in graph [node ])
220
+ {
216
221
path .Add (targetNode );
217
222
218
223
dfs (targetNode );
You can’t perform that action at this time.
0 commit comments