Prompt
What is the primary difference between the `String` and `&str` types in Rust? A) `String` is allocated on the stack with fixed size, whereas `&str` is dynamically resized on the heap. B) `String` is an immutable reference, whereas `&str` is an owned, growable UTF-8 string. C) `&str` can only represent string literals hardcoded in the compiled binary. D) `String` is an owned, growable heap-allocated buffer, whereas `&str` is a string slice borrowing a view of UTF-8 data. Reply with the letter of the correct option (A, B, C, or D).
Expected output
D
| model | score | output |
|---|---|---|
| kwaipilot/kat-coder-pro-v2.5 | 100% | D |
| qwen/qwen3.7-max | 100% | D |
| gpt-5.5-pro | 100% | D |