摘要: 给一个数组,如果数组中存在相同数字,且相同数字的距离小于给定值k,输出YES,否则输出NO。 注意事项输入的数组长度为n,保证n <= 100000。数组元素的值为x,0 <= x <= 1e9。输入的k满足 1 <= k < n。您在真实的面试中是否遇到过这个题? 样例给出 array = [1, 阅读全文
posted @ 2018-04-21 23:51 皇家大鹏鹏 阅读(440) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/li_ning_/article/details/52383865 c++ sort 对 pair<int,int> 的排序问题 https://www.zhihu.com/question/52960398 仿函数的使用简介: https://blog. 阅读全文
posted @ 2018-04-21 11:32 皇家大鹏鹏 阅读(261) 评论(0) 推荐(0) 编辑