Qed jitgħabba l-eżerċizzju…
Sometimes data is stored in a compressed form: first comes how many times to repeat a value, then the value itself. Given a list nums, each pair of elements represents a repeat count and the number to insert. Decode all pairs in order and return the resulting list.
[1, 2, 3, 4][2, 4, 4, 4][1, 1, 2, 3][1, 3, 3][0, 5, 2, 7][7, 7]def decompress_rl_elist(nums: list[int]) -> list[int]:
Idħol biex tara l-istorja tas-sottomissjonijiet
IdħolIdħol biex tuża l-Mentor tal-AI
Idħol[1,2,3,4][2,4,4,4][1,1,2,3][1,3,3][0,5,2,7][7,7][3,9][9,9,9][1,0,1,0][0,0][0,0,0,0][]