当前位置:网站首页>[leetcode] day91- duplicate elements exist
[leetcode] day91- duplicate elements exist
2022-07-01 06:20:00 【Upside down, it's a circle】
subject
217. There are duplicate elements 【 Simple 】
Answer key
class Solution {
public boolean containsDuplicate(int[] nums) {
Set<Integer>hashSet=new HashSet<>();
for(int i=0;i<nums.length;i++){
if(hashSet.contains(nums[i]))
return true;
hashSet.add(nums[i]);
}
return false;
}
}
Time complexity : O ( n ) O(n) O(n)
Spatial complexity : O ( n ) O(n) O(n)
边栏推荐
- B-树系列
- Flink practice -- multi stream merge
- ABP 学习解决方案中的项目以及依赖关系
- three. JS summary
- Distributed lock implementation
- OpenGL es: (1) origin of OpenGL es (transfer)
- SystemVerilog learning-10-validation quantification and coverage
- Small guide for rapid completion of mechanical arm (VI): stepping motor driver
- Highmap gejson data format conversion script
- 做技术,自信不可或缺
猜你喜欢

JDBC database operation
![[file system] how to run squashfs on UBI](/img/d7/a4769420c510c47f3c2a615b514a8e.png)
[file system] how to run squashfs on UBI

The row and column numbers of each pixel of multi-source grid data in the same area are the same, that is, the number of rows and columns are the same, and the pixel size is the same

Discrimination between left and right limits of derivatives and left and right derivatives

指数法和Random Forest实现山东省丰水期地表水体信息

3D打印机穿线:5种简单的解决方案

ONEFLOW source code parsing: automatic inference of operator signature

Skywalking integrated Nacos dynamic configuration

让厦门灌口镇田头村变“甜头”村的特色农产品之一是

Database problems, how to optimize Oracle SQL query statements faster and more efficient
随机推荐
高阶-二叉平衡树
Index method and random forest to realize the information of surface water body in wet season in Shandong Province
Excel visualization
Essay learning record essay multi label Global
Talking from mlperf: how to lead the next wave of AI accelerator
Factorial divisor (unique decomposition theorem)
1034 Head of a Gang
Record currency in MySQL
SOE空间分析服务器 MySQL以及PostGres的地理空间库PostGIS防注入攻击
地宫取宝(记忆化深搜)
PLA不粘貼在床上:6個簡單的解决方案
One of the characteristic agricultural products that make Tiantou village, Guankou Town, Xiamen into a "sweet" village is
连续四年入选Gartner魔力象限,ManageEngine卓豪是如何做到的?
golang panic recover自定义异常处理
数据库产生死锁了请问一下有没有解决办法
3D printer threading: five simple solutions
pycharm 配置jupyter
Treasure taking from underground palace (memory based deep search)
How does MySQL store Emoji?
jdbc-连接池