Short Answer

Debugging a Sequence Slicing Function

A programmer is implementing a function to extract a 'context window' of n items from a long sequence. The window should end at the current position, i. The programmer's code uses i - n as the starting index for the slice. Explain why this calculation is incorrect and what the correct starting index expression should be.

0

1

Updated 2025-10-03

Contributors are:

Who are from:

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Computing Sciences

Foundations of Large Language Models Course

Analysis in Bloom's Taxonomy

Cognitive Psychology

Psychology

Social Science

Empirical Science

Science