当前位置:网站首页>leetcode:27. 移除元素【count remove小操作】
leetcode:27. 移除元素【count remove小操作】
2022-04-23 01:55:00 【白速龙王的回眸】
分析
用count统计一下相等的个数
然后remove掉
ac code
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
for i in range(nums.count(val)):
nums.remove(val)
return len(nums)
总结
简单模拟
版权声明
本文为[白速龙王的回眸]所创,转载请带上原文链接,感谢
https://bridge-killer.blog.csdn.net/article/details/124357520
边栏推荐
- 42. Use k3det in mmrotate for rotating target detection, MNN deployment and ncnn deployment
- keil mdk中文乱码,两种解决方法,字体不再难看
- PID精讲
- Is CICC fortune a state-owned enterprise and is it safe to open an account
- 2022.4.20-----leetcode.388
- 搭建网站是用物理机还是云主机好?
- What problems will you encounter when dialing VPS?
- 代理IP可用率是不是等同于代理IP的效率?
- 批处理多个文件合成一个HEX
- W801/W800/W806唯一ID/CPUID/FLASHID
猜你喜欢
如何对代理IP进行分类?
Communication summary between MCU and 4G module (EC20)
Longest common subsequence (record path version)
PHP & laravel & master several ways of generating token by API and some precautions (PIT)
电子采购如何成为供应链中的增值功能?
How can e-procurement become a value-added function in the supply chain?
Encrypted compressed backup bat script
Uncover floating-point operations hidden by the ARM compiler
W801 / w800 / w806 unique ID / CPUID / flashid
MySQL basic record
随机推荐
What are the common proxy IP problems?
Jerry's CPU performance test [chapter]
C语言中如何“指名道姓”的进行初始化
npm——配置淘宝镜像
2022第六季完美童模 IPA國民賽領跑元宇宙賽道
About how to import C4d animation into lumion
Shardingsphere sub database and sub table
Do447 manage user and team access
What is a dial-up server and what is its use?
How to install mysql-5.7.9 in RPM mode under Linux system
Dimension C China helping farmers in rural areas warms people's hearts the third stop is jiabaoguo farm
什么是api接口?
使用单元测试框架编写单元测试的好处?
What is an API interface?
什么是布尔类型?
English abbreviation of role personal attribute
拨号服务器是什么,有什么用处?
postman里面使用 xdebug 断点调试
Basic knowledge of software testing, you can meet the interviewer after reading it
EBS:PO_ EMPLOYEE_ HIERARCHIES_ ALL