五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

LeetCode 2729. Check if The Number is Fascinating

2023-06-11 09:31 作者:您是打尖兒還是住店呢  | 我要投稿

You are given an integer?n?that consists of exactly?3?digits.

We call the number?n?fascinating?if, after the following modification, the resulting number contains all the digits from?1?to?9?exactly?once and does not contain any?0's:

  • Concatenate?n?with the numbers?2 * n?and?3 * n.

Return?true?if?n?is fascinating, or?false?otherwise.

Concatenating?two numbers means joining them together. For example, the concatenation of?121?and?371?is?121371.

?

Example 1:

Input: n = 192

Output: true

Explanation: We concatenate the numbers n = 192 and 2 * n = 384 and 3 * n = 576. The resulting number is 192384576. This number contains all the digits from 1 to 9 exactly once.

Example 2:

Input: n = 100

Output: false

Explanation: We concatenate the numbers n = 100 and 2 * n = 200 and 3 * n = 300. The resulting number is 100200300. This number does not satisfy any of the conditions.

?

Constraints:

  • 100 <= n <= 999

模擬遍歷即可,只是注意下false的情形即可;

下面是代碼:

Runtime:?4 ms, faster than?28.57%?of?Java?online submissions for?Check if The Number is Fascinating.

Memory Usage:?40.2 MB, less than?28.57%?of?Java?online submissions for?Check if The Number is Fascinating.


LeetCode 2729. Check if The Number is Fascinating的評(píng)論 (共 條)

使用qq登录你需要登录后才可以评论。
彝良县| 定西市| 玉环县| 宣威市| 深水埗区| 安丘市| 金乡县| 三河市| 双城市| 增城市| 仪陇县| 阿勒泰市| 滁州市| 新乡市| 宜城市| 博罗县| 江口县| 丹寨县| 双流县| 烟台市| 上蔡县| 太原市| 荆州市| 乌兰浩特市| 晋中市| 信阳市| 沁阳市| 民县| 大丰市| 长治县| 定西市| 龙州县| 新干县| 浮山县| 大荔县| 浏阳市| 晋城| 垫江县| 林甸县| 横山县| 钟祥市|