cybersecurity · beginner · ~15 min · safe pentest lab

Does the bundle fit?

Check a size against a limit.

Challenge

Check whether an evidence bundle fits within a storage or transfer limit.

Task

Implement int fits_archive(long total, long max) that returns 1 if total <= max, and 0 otherwise.

Input

  • total: the bundle's total size.
  • max: the allowed limit.

Output

Returns 1 if the bundle fits (total <= max), 0 otherwise.

Example

fits_archive(900, 1000)    ->   1
fits_archive(1100, 1000)   ->   0

Edge cases

  • total exactly equal to max fits (return 1).

Input format

The bundle size total and the limit max (long).

Output format

1 if total <= max; otherwise 0.

Constraints

total == max counts as fitting.

Starter code

int fits_archive(long total, long max) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.