File size: 378 Bytes
2d2c6e4
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# EXISTING CODE - DO NOT MODIFY (Treat as Read-Only Library)


def get_paged_items(items: list, page: int, page_size: int) -> list:
    """
    Existing buggy/unsafe pagination logic.
    - Fails on page 0 (returns negative slice)
    - No type checking
    - No bounds checking
    """
    start = (page - 1) * page_size
    end = start + page_size
    return items[start:end]