当前位置:网站首页>leetcode6132. Make all elements in an array equal to zero (simple, weekly)
leetcode6132. Make all elements in an array equal to zero (simple, weekly)
2022-08-01 03:08:00 【heavy rubbish】
Idea: Kinds of numbers greater than 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();}};
边栏推荐
- HCIP(14)
- IDEA调试
- 【SemiDrive源码分析】系列文章链接汇总(全)
- Browser download shortcut to desktop (PWA)
- The device node structure is converted into a platform_device structure
- Take you to experience a type programming practice
- MYSQL logical architecture
- Flink 部署和提交job
- Open source project site must-have & communication area function
- 更换树莓派内核
猜你喜欢
树莓派 的 arm 版的 gcc 安装 和环境变量的配置
Google Earth Engine - Error resolution of Error: Image.clipToBoundsAndScale, argument 'input': Invalid type
Four ways the Metaverse is changing the way humans work
Solve the problem that when IDEA creates a new file by default, right-click, new, there is no XML file
HCIP(15)
【数据分析】基于matlab GUI学生成绩管理系统【含Matlab源码 1981期】
Flutter “Hello world“ 程代码
【消息通知】用公众号模板消息怎么样?
How to get started with YOLO?How to implement your own training set?
You need to know the TCP wave four times
随机推荐
Flink deploys and submits jobs
数据中台建设(七):数据资产管理
IDEA修改注释字体
Completely closed Chrome updated and in the top right corner of the tip
【SemiDrive源码分析】系列文章链接汇总(全)
Browser download shortcut to desktop (PWA)
opencv 缩小放大用哪种插值更好??
如何下载Keil包
【数据分析】基于matlab GUI学生成绩管理系统【含Matlab源码 1981期】
Basic Theoretical Knowledge of Software Testing - Use Cases
解决IDEA默认情况下新建文件时,右击,new,没有XML文件的问题
Solve the problem that when IDEA creates a new file by default, right-click, new, there is no XML file
Daily practice of LeetCode - Circular linked list question (interview four consecutive questions)
黑客到底可以厉害到什么程度?
剑指offer专项突击版第16天
When opening a MYSQL table, some can display editing, some do not, how to set.
Soft Exam Senior System Architect Series: Basic Knowledge of Information Systems
Basic usage concepts of vim
Soft Exam Senior System Architect Series: Basic Knowledge of System Development
Introduction to the decision logic of WAASAP WebClient UI page labels