Example 1.
Instruction: Prefer const for bindings that are not reassigned and cache array lengths before loops to avoid repeated property access.
Reasoning: This contains two unrelated instructions (const usage and caching array length). Since they are not a coherent single instruction, we will discard them and tag them as invalid.
Category: invalid-instruction

Example 2.
Instruction: Collapse difference-array operations into a single prefix sum loop when feasible to simplify range updates and improve performance.
Reasoning: The user suggests using a prefix sum loop instead of multiple difference-array operations. This is one coherent instruction so it is valid.
Category: use-prefix-sum-precomputation

Example 3.
Instruction: Add length judgment to improve efficiency.
Reasoning: The user asks to add a length check (conditional logic) to improve efficiency.
Category: use-conditional-on-length

Example 4.
Instruction: Use a Map to track score frequencies and properly update counts when scores change.
Reasoning: The user wants to use a Map for counting and updating frequencies.
Category: use-map-for-frequencies

Example 5.
Instruction: Prefer const for bindings that are not reassigned.
Reasoning: User wants const when variables are not reassigned.
Category: use-const-for-immutables

Example 6.
Instruction: Avoid deeply nested if-else chains when logic can be encoded in data structures.
Reasoning: The user suggests replacing deep conditional chains with data-structure-driven logic.
Category: avoid-deep-nested-if-else

Example 7.
Instruction: Modularize logic to enhance code readability.
Reasoning: The user suggests encapsulating logic into functions to improve readability.
Category: encapsulate-logic-into-function

Example 8.
Instruction: Use reduce() to quickly complete the multiplication. 
Reasoning: The user requests using a specific function in javascript.
Category: use-reduce