实现的代码如下:
1 | class Solution { |
这题如果暴力两遍循环的话只能过42个数据点,还有2个过不了,所以考虑用到sort排序的话就是O(nlogn)的时间复杂度了,然后就AC
实现的代码如下:
1 | class Solution { |
这题如果暴力两遍循环的话只能过42个数据点,还有2个过不了,所以考虑用到sort排序的话就是O(nlogn)的时间复杂度了,然后就AC
原文作者:Maple
原文链接:http://yoursite.com/2019/04/07/leetcode-169/
发表日期:April 7th 2019, 3:33:46 pm
更新日期:April 7th 2019, 3:43:02 pm
版权声明:本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: true
tags: true