Storage Quota Check

Before uploading files, it is useful to check whether they fit into the available storage quota. Given file sizes sizes in bytes and a byte limit quota, return True if the total size of all files does not exceed the quota. If there are no files, their total size is 0.

Примеры

Ввод
[100, 200, 300], 1000
Вывод
True
Ввод
[500, 600], 1000
Вывод
False
Ввод
[], 0
Вывод
True

Нужно реализовать

def fits_quota(sizes, quota):

Теги

arraylistsmath
PostgreSQLv16

Hier verschijnt het resultaat van je code

Visible tests
1
Input
[100,200,300], 1000
ExpectedTrue
2
Input
[500,600], 1000
ExpectedFalse
3
Input
[], 0
ExpectedTrue
4
Input
[1000], 1000
ExpectedTrue
5
Input
[1,1,1], 2
ExpectedFalse
6
Input
[100,200,300], 0
ExpectedFalse
Focus radio
Paused · SomaFM · Fluid