当前位置:网站首页>leetcode6132. 使数组中所有元素都等于零(简单,周赛)
leetcode6132. 使数组中所有元素都等于零(简单,周赛)
2022-08-01 02:45:00 【重you小垃】
思路:大于0的数字种类
class Solution {
public:
int minimumOperations(vector<int>& nums) {
int n = nums.size();
set<int> st;
for (int i = 0; i < n; +i) {
if (nums[i]) st.insert(nums[i]);
}
return st.size();
}
};
边栏推荐
- Chain programming, packages, access
- STK8321 I2C (Shengjia-accelerometer) example
- Talking about hardware device computing storage and data interaction
- You need to know the TCP wave four times
- Detailed explanation of TCP protocol
- 787. 归并排序
- 初出茅庐的小李第114篇博客项目笔记之机智云智能浇花器实战(3)-基础Demo实现
- leetcode:1648. 销售价值减少的颜色球【二分找边界】
- [cellular automata] based on matlab interface aggregation cellular automata simulation [including Matlab source code 2004]
- 【SemiDrive源码分析】系列文章链接汇总(全)
猜你喜欢
Ordinary users cannot access HGFS directory
How to download the Keil package
设备树——dtb格式到struct device node结构体的转换
You need to know the TCP wave four times
Basic implementation of vector
【分层强化学习】HIRO:Data-Efficient Hierarchical Reinforcement Learning
【入门教程】Rollup模块打包器整合
MYSQL logical architecture
Compiled on unbutu with wiringPi library and run on Raspberry Pi
The bigger and bigger the project is, I split it like this
随机推荐
High dimensional Gaussian distribution basics
IDEA modifies the annotation font
【消息通知】用公众号模板消息怎么样?
date command
Key Points Estimation and Point Instance
带你体验一次类型编程实践
Which interpolation is better for opencv to zoom in and out??
【元胞自动机】基于matlab界面聚合元胞自动机模拟【含Matlab源码 2004期】
The device node structure is converted into a platform_device structure
HCIP(15)
test
测试
指定set 'execution.savepoint.path'后,重启flinksql报这个错是啥
Completely closed Chrome updated and in the top right corner of the tip
Euler system (euleros): upgrade Mysql
Replacing the Raspberry Pi Kernel
机器学习初学者可以学哪些实战项目?
MYSQL-Batch insert data
手写二叉查找树及测试
Academicians of the two academies speak bluntly: Don't be superstitious about academicians