题解 | #搜索数字#

https://www.nowcoder.com/practice/f7df2b13dce44b7498a13c1df1652779

const isDigit = (c) => '0123456789'.indexOf(c) != -1;

function _search(s) {
    for (const c of s) {
        if (isDigit(c)) return true;
    }
    return false;
}

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务