当前位置:网站首页>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();
}
};
边栏推荐
- 【Make YOLO Great Again】YOLOv1-v7全系列大解析(Neck篇)
- 软考高级系统架构设计师系列之:系统开发基础知识
- 机器学习初学者可以学哪些实战项目?
- /usr/sbin/vmware-authdlauncher: error while loading shared libraries: libssl.so.1.0.2*Solution
- LeetCode每日一练 —— 环形链表问题(面试四连问)
- IDEA修改注释字体
- Fat interface in JQESAP system
- 北京突然宣布,元宇宙重大消息
- 《少年派2》:新男友竟脚踩两只船,林妙妙与钱三一感情回温
- Nmap manuals - the full version
猜你喜欢
这个地图绘制工具太赞了,推荐~~
Solve the problem that when IDEA creates a new file by default, right-click, new, there is no XML file
MYSQL Index Analysis
HIRO: Hierarchical Reinforcement Learning 】 【 Data - Efficient Hierarchical Reinforcement Learning
HCIP(15)
MYSQL two-phase commit
Summary of JVM interview questions (continuously updated)
被 CSDN,伤透了心
【 】 today in history: on July 31, "brains in vats" the birth of the participant;The father of wi-fi was born;USB 3.1 standard
IDEA modifies the annotation font
随机推荐
The fledgling Xiao Li's 114th blog project notes: Wisdom cloud intelligent flower watering device combat (3) - basic Demo implementation
软考高级系统架构设计师系列之:系统开发基础知识
IDEA does not recognize the module (there is no blue square in the lower right corner of the module)
Key Points Estimation and Point Instance
C string array reverse
IDEA修改注释字体
二舅
By Value or By Reference
Summary of JVM interview questions (continuously updated)
2022 CSP-J1 CSP-S1 Round 1 Preliminary Competition Registration Guide
WebApi 打个Attribute 统一处理异常
机器学习应该如何入门?
Basic usage concepts of vim
How is the tree structure of the device tree reflected?
how to edit the table of contents of an epub ebook
opencv 缩小放大用哪种插值更好??
IDEA debugging
SC7A20 (Silan Micro-Accelerometer) Example
手写二叉查找树及测试
Basic use of vim - command mode