โจทย์
Build one row of a multiplication table: number × 1, number × 2, … up to number × count.
Implement multiplication_row(number, count).
Input
number: The number to multiply. count: How many multiples to list.
Output
Return the list of multiples in order.
เงื่อนไข
-1,000 ≤ number ≤ 1,000; 0 ≤ count ≤ 100
ตัวอย่าง
ตัวอย่างที่ 1
อินพุต:
count = 5
number = 3
ผลลัพธ์ที่คาดหวัง:
expected = [3, 6, 9, 12, 15]
อินพุต:
long long count = 5;
long long number = 3;
ผลลัพธ์ที่คาดหวัง:
std::vector<long long> expected = {3, 6, 9, 12, 15};
อินพุต:
long count = 5;
long number = 3;
ผลลัพธ์ที่คาดหวัง:
long[] expected = new long[] {3, 6, 9, 12, 15};
คำอธิบาย
3×1, 3×2, 3×3, 3×4, 3×5 = 3, 6, 9, 12, 15.
ตัวอย่างที่ 2
อินพุต:
count = 0
number = 7
ผลลัพธ์ที่คาดหวัง:
expected = []
อินพุต:
long long count = 0;
long long number = 7;
ผลลัพธ์ที่คาดหวัง:
std::vector<long long> expected = {};
อินพุต:
long count = 0;
long number = 7;
ผลลัพธ์ที่คาดหวัง:
long[] expected = new long[] {};
คำอธิบาย
Zero multiples were requested, so the list is empty.
แหล่งอ้างอิง
โจทย์นี้ปรับให้เหมาะกับ CodeUtility กรุณาทำตามคำชี้แจงและข้อจำกัดด้านบน