当前位置:网站首页>Daily question - ugly number
Daily question - ugly number
2022-07-03 04:05:00 【々 orange if ℃ №】
Learning goals :
A daily topic - Ugly number
source : Power button (LeetCode)
link :https://leetcode-cn.com/problems/ugly-number
Copyright belongs to the network . For commercial reprint, please contact the official authority , Non-commercial reprint please indicate the source .
Learning content :
Give you an integer n , Please judge n Is it Ugly number . If it is , return true ; otherwise , return false .
Ugly number That is, only the prime factor is included 2、3 and / or 5 The positive integer .

solution :
class Solution:
def isUgly(self, n: int) -> bool:
if n<= 0:
return False
for item in [2,3,5]:
while n % item == 0:
n//=item
return n == 1

边栏推荐
- 2022 tea master (primary) examination questions and tea master (primary) examination question bank
- 在写web项目的时候,文件上传用到了smartupload,用了new string()进行转码,但是在数据库中,还是会出现类似扑克的乱码
- Is pytorch open source?
- In Net 6 project using startup cs
- 『期末复习』16/32位微处理器(8086)基本寄存器
- 【刷题篇】多数元素(超级水王问题)
- 中移物联网OneOS与OneNET入选《2021年物联网示范项目名单》
- Arlo's thinking about himself
- [brush questions] find the number pair distance with the smallest K
- Interface embedded in golang struct
猜你喜欢

CVPR 2022 | Dalian Technology propose un cadre d'éclairage auto - étalonné pour l'amélioration de l'image de faible luminosité de la scène réelle

Ffmpeg recording screen and screenshot

Appium自动化测试框架

"Final review" 16/32-bit microprocessor (8086) basic register

When writing a web project, SmartUpload is used for file upload and new string () is used for transcoding, but in the database, there will still be random codes similar to poker

300+ documents! This article explains the latest progress of multimodal learning based on transformer

2022 tea master (intermediate) examination questions and analysis and tea master (intermediate) practical examination video
![[home push IMessage] software installation virtual host rental tothebuddy delay](/img/e7/eb20a773e4b674962f856d179a3769.jpg)
[home push IMessage] software installation virtual host rental tothebuddy delay

2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =

2022 tea master (intermediate) examination questions and analysis and tea master (intermediate) practical examination video
随机推荐
js实现在可视区内,文字图片动画效果
[Apple Push] IMessage group sending condition document (push certificate) development tool pushnotification
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Is it better to speculate in the short term or the medium and long term? Comparative analysis of differences
IPv6过渡技术-6to4手工隧道配置实验--尚文网络奎哥
[Apple Photo Album push] IMessage group anchor local push
golang xxx. Go code template
CVPR 2022 | Dalian Technology propose un cadre d'éclairage auto - étalonné pour l'amélioration de l'image de faible luminosité de la scène réelle
C language hashtable/hashset library summary
Nat. Comm. | use tensor cell2cell to deconvolute cell communication with environmental awareness
2022 P cylinder filling examination content and P cylinder filling practice examination video
学会pytorch能干什么?
Use of sigaction
【刷题篇】 找出第 K 小的数对距离
Cnopendata China Customs Statistics
Read a paper_ ChineseBert
Idea shortcut keys
JS实现图片懒加载
8.8.2-PointersOnC-20220214
Separable bonds and convertible bonds