Categories
Easy Problems

โจทย์เขียนโปรแกรมข้อ VZ0073

จงเขียนฟังก์ชั่นที่รับค่า array ของ integer กับ integer อีกตัว แล้วส่งค่าออกมาเป็น true ถ้า สมาชิกทั้งหมด ใน array สามารถหาร integer ตัวที่สองลงตัว นอกเหนือจากนั้นให้ส่งค่า false ออกมา

Examples
checkFactors([2, 3, 4], 12) ➞ true

checkFactors([1, 2, 3, 8], 12) ➞ false

checkFactors([1, 2, 50], 100) ➞ true

checkFactors([3, 6], 9) ➞ false

เฉลย ด้วยภาษา Python

Leave a Reply