Get the minimum number of two segments


Problem surface

An arbitrary positive integer n, find the minimum number of two segments larger than N and a multiple of n

A binary number is a positive integer that contains exactly two different decimal numbers s and T, s is not 0, and all occurrences of s are arranged in front of all t

For example, 4411 is a two segment number (s is 4, t is 1), and so are 41, 10000000, and 555556.

But 44114 and 44444 are not two segment numbers.


  1. Number of regular judgment segments
  2. Multiple find minimum jump loop


import re


(base) D:\code-base\python\test>python -u "d:\code-base\python\test\"
1: 10
2019: 9999999993

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Heavyweight Tencent cloud open source industry’s first etcd one-stop governance platform kstone

​ Kstone open source At the kubecon China Conference held by CNCF cloud native foundation on December 9, 2021,Tencent cloud container tke team released the open source project of kstone etcd governance platform. KstoneIt was initiated by the TKE team of Tencent cloud containerCloud native one-stop etcd governance project based on kubernetes。 The project originates […]