当前位置:网站首页>Daily question 3 (2): check binary string field
Daily question 3 (2): check binary string field
2022-06-27 13:47:00 【Programmed ape without hair loss 2】
subject :
Give you a binary string s , The string Without leading zeros .
If s contain Zero or one by continuous ‘1’ The fields made up of , return true . otherwise , return false .
Example 1:
Input :s = “1001”
Output :false
explain : In the string 1 Not forming a continuous field .
Example 2:
Input :s = “110”
Output :true
Tips :
1 <= s.length <= 100
s[i] by ‘0’ or ‘1’
s[0] by ‘1’
Ideas :
The meaning of this question is not easy to understand , Actually, I want to check whether the string contains ’01’, It is suggested to have a look at this question , Omission as an important topic
java Code :
class Solution {
public boolean checkOnesSegment(String s) {
return !s.contains("01");
}
}
边栏推荐
- 【问题解决】Tensorflow中run究竟运行了哪些节点?
- Axi bus
- Cesium realizes satellite orbit detour
- ensp云朵配置
- #yyds干货盘点# 解决剑指offer:剪绳子(进阶版)
- 新华三的千亿企业梦,还得靠吃ICT老本来实现?
- 快讯:华为启动鸿蒙开发者大赛;腾讯会议发布“万室如意”计划
- 【周赛复盘】LeetCode第81场双周赛
- What if the win system cannot complete the update and is revoking the status change
- 【第27天】给定一个整数 n ,打印出1到n的全排列 | 全排列模板
猜你喜欢

Pre training weekly issue 51: reconstruction pre training, zero sample automatic fine tuning, one click call opt

Daily question brushing record (6)

Half find (half find)

Implementing springboard agent through SSH port forwarding configuration

每日刷題記錄 (六)

Using FRP tool to realize intranet penetration
![[WUSTCTF2020]girlfriend](/img/a8/33fe5feb7bcbb73ba26a94d226cc4d.png)
[WUSTCTF2020]girlfriend

What if the win system cannot complete the update and is revoking the status change

What kind of air conditioner is this?

《预训练周刊》第51期:重构预训练、零样本自动微调、一键调用OPT
随机推荐
Realization of hospital medical record management system based on JSP
Kyndryl与Oracle和Veritas达成合作
命令行编辑器 sed 基础用法总结
Deep understanding of bit operations
enable_if
招标公告:上海市研发公共服务平台管理中心Oracle一体机软硬件维保项目
PCL库——报错解决:安装时遇到的cmake与anaconda的冲突问题
Pytorch learning 1 (learning documents on the official website)
现在开户有优惠吗?网上开户是否安全么?
MySQL index and its classification
[dynamic programming] - Knapsack Problem
Crane: a new way of dealing with dictionary items and associated data
[a complete human-computer interface program framework]
AXI總線
Journal quotidien des questions (6)
Daily question brushing record (6)
The second part of the travel notes of C (Part II) structural thinking: Zen is stable; all four advocate structure
【mysql进阶】MTS主从同步原理及实操指南(七)
[day 27] given an integer n, print out the full permutation from 1 to n | Full Permutation template
基于 xml 配置文件的入门级 SSM 框架整合