diff --git a/problems/0056.合并区间.md b/problems/0056.合并区间.md index e84a1634..85719a25 100644 --- a/problems/0056.合并区间.md +++ b/problems/0056.合并区间.md @@ -171,7 +171,32 @@ Python: Go: +```Go +func merge(intervals [][]int) [][]int { + sort.Slice(intervals, func(i, j int) bool { + return intervals[i][0] b { return a } + return b +} +``` @@ -179,4 +204,4 @@ Go: * 作者微信:[程序员Carl](https://mp.weixin.qq.com/s/b66DFkOp8OOxdZC_xLZxfw) * B站视频:[代码随想录](https://space.bilibili.com/525438321) * 知识星球:[代码随想录](https://mp.weixin.qq.com/s/QVF6upVMSbgvZy8lHZS3CQ) -
\ No newline at end of file +