网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  leetcode1015

leetcode1015

分类: IT文章 • 2022-03-30 18:56:33

leetcode1015

1 class Solution(object):
2     def smallestRepunitDivByK(self, K: int) -> int:
3         if K % 2 == 0 or K % 5 == 0: 
4             return -1
5         r = 0
6         for N in range(1, K + 1):
7             r = (r * 10 + 1) % K
8             if r == 0: 
9                 return N

相关推荐

  • leetcode1015
  • linux分区方案
  • leetcode1016
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号