Loading...
Given multiple sequences of integers (one per line), pad all sequences to the length of the longest sequence by appending zeros at the end.
Input format:
Output: Each padded sequence as a list.
3 1 2 3 4 5 6
[1, 2, 3] [4, 5, 0] [6, 0, 0]
Step 1: Find max length Lengths: 3, 2, 1 → max = 3
Step 2: Pad each sequence to length 3 [1, 2, 3] → already length 3 [4, 5] → [4, 5, 0] [6] → [6, 0, 0]