Categories
Medium Problems

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

จงเขียนฟังก์ชั่นที่รับ string เข้าไป 3 ค่าคือ first, last และ word แล้วให้ส่งค่า true ออกมาหาก word นั้นอยู่ระหว่าง first และ last ใน dictionary นอกนั้นเป็น false

Examples

isBetween(” apple”,”banana”,”azure”) ➞ true

isBetween (“monk”,”monument”,”monkey”) ➞ true

isBetween (“bookend”,”boolean”,”boost”) ➞ false

Leave a Reply