File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed
solution/0000-0099/0063.Unique Paths II Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -414,29 +414,6 @@ function uniquePathsWithObstacles(obstacleGrid: number[][]): number {
414
414
}
415
415
```
416
416
417
- #### TypeScript
418
-
419
- ``` ts
420
- function uniquePathsWithObstacles(obstacleGrid : number [][]): number {
421
- const m = obstacleGrid .length ;
422
- const n = obstacleGrid [0 ].length ;
423
- const f: number [][] = Array .from ({ length: m }, () => Array (n ).fill (- 1 ));
424
- const dfs = (i : number , j : number ): number => {
425
- if (i >= m || j >= n || obstacleGrid [i ][j ] === 1 ) {
426
- return 0 ;
427
- }
428
- if (i === m - 1 && j === n - 1 ) {
429
- return 1 ;
430
- }
431
- if (f [i ][j ] === - 1 ) {
432
- f [i ][j ] = dfs (i + 1 , j ) + dfs (i , j + 1 );
433
- }
434
- return f [i ][j ];
435
- };
436
- return dfs (0 , 0 );
437
- }
438
- ```
439
-
440
417
#### Rust
441
418
442
419
``` rust
You can’t perform that action at this time.
0 commit comments