Categories
Easy Problems

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

จงเขียนฟังก์ชั่นที่รับค่า array ของ integer กับ index เข้าไป แล้วส่งค่าใน array ที่ต้องกับ index นั้นออกมา (0-indexed)

Examples
valueAt([1, 2, 3, 4, 5, 6], 10 / 2) ➞ 6

valueAt([1, 2, 3, 4, 5, 6], 8 / 2) ➞ 5

valueAt([1, 2, 3, 4], 6.535355314 / 2) ➞ 4

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

Leave a Reply