Categories
Medium Problems

โจทย์ข้อที่ MX0009

จงเขียนฟังก์ชั่นที่รับค่า string เข้าไป แล้วหากเจอคำว่า “bomb” ให้ส่งคำว่า “duck!” ออกมา หากไม่เจอให้ส่ง “relax there’s no bomb.” ออกมา

examples=””

bomb(“there is a bomb.”) ➞ true

bomb(“hey, did you think there bomb?”) ➞ true

bomb(“this goes boom!!!”) ➞ false

Leave a Reply