Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.
定义一个hash表,存储 数字 和 对应的index。
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.
定义一个hash表,存储 数字 和 对应的index。
本文标题:219. Contains Duplicate II
本文链接:https://www.haomeiwen.com/subject/bkhvlttx.html
网友评论