Categories
Easy Problems

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

จงเขียนฟังก์ชั่นที่แสดงค่าผลลัพธ์ของการ upvote และ downvote ของโพส โดยรับค่า upvote และ downvote เข้าไป

Examples
getVoteCount({ upvotes: 13, downvotes: 0 }) ➞ 13

getVoteCount({ upvotes: 2, downvotes: 33 }) ➞ -31

getVoteCount({ upvotes: 132, downvotes: 132 }) ➞ 0

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

Leave a Reply