C# one line with linq
\n    public int MinimumEffort(int[][] tasks) {\n            return tasks.OrderBy(x => x[1] - x[0]).Aggregate(0, (result, x) => Math.Max(result + x[0], x[1])); 
```\n    public int MinimumEffort(int[][] tasks) {\n            return tasks.OrderBy(x => x[1] - x[0]).Aggregate(0, (result, x) => Math.Max(result + x[0], x[1])); \n    }\n```
[]