【leetcode_easy_string】1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence

problem

1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence

solution#1: 使用string的特性和count函数;

code

 

 

solution#2: 通过空格split得到字符,然后判断;

code

 

 

参考

1. leetcode_easy_string_1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence;

2. count函数

posted on 2020-12-20 17:08  鹅要长大  阅读(101)  评论(0编辑  收藏  举报

导航