จงเขียนฟังก์ชั่นที่รับ string เข้าไปแล้ว ส่งค่าจำนวนตัวอักษร d กับ D ทั้งหมดที่อยู่ใน array นั้น ออกมา
Examples
countDs(“my friend dylan got distracted in school.”) ➞ 4
countDs(“debris was scattered all over the yard.”) ➞ 3
จงเขียนฟังก์ชั่นที่รับ string เข้าไปแล้ว ส่งค่าจำนวนตัวอักษร d กับ D ทั้งหมดที่อยู่ใน array นั้น ออกมา
Examples
countDs(“my friend dylan got distracted in school.”) ➞ 4
countDs(“debris was scattered all over the yard.”) ➞ 3