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

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

LeetCode 1016. Binary String With Substrings Representing 1 To N

2023-05-11 07:53 作者:您是打尖兒還是住店呢  | 我要投稿

Given a binary string?s?and a positive integer?n, return?true?if the binary representation of all the integers in the range?[1, n]?are?substrings?of?s, or?false?otherwise.

A?substring?is a contiguous sequence of characters within a string.

?

Example 1:

Input: s = "0110", n = 3

Output: true

Example 2:

Input: s = "0110", n = 4

Output: false

?

Constraints:

  • 1 <= s.length <= 1000

  • s[i]?is either?'0'?or?'1'.

  • 1 <= n <= 109

使用自帶函數(shù)Integer.toBinaryString()就可以的,遍歷確認(rèn)接,下面是代碼:

Runtime:?0 ms, faster than?100.00%?of?Java?online submissions for?Binary String With Substrings Representing 1 To N.

Memory Usage:?40.4 MB, less than?72.27%?of?Java?online submissions for?Binary String With Substrings Representing 1 To N.


LeetCode 1016. Binary String With Substrings Representing 1 To N的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
威宁| 六枝特区| 德清县| 政和县| 旌德县| 当涂县| 寿阳县| 靖边县| 临颍县| 鄂伦春自治旗| 岫岩| 永登县| 邵武市| 河曲县| 云浮市| 阿瓦提县| 横峰县| 开鲁县| 随州市| 屯门区| 东山县| 阿城市| 平武县| 海原县| 鄂托克前旗| 安丘市| 合作市| 锡林浩特市| 汶上县| 天津市| 海林市| 辉县市| 仁化县| 白朗县| 兰州市| 郴州市| 泸溪县| 红安县| 富源县| 重庆市| 乐业县|