Challenge - generic2
3.12.1
type checker:  pyright

Complete code following the instructions, so that lines followed by # expect-type-error (if any) fail type check, while others can pass.
Hit the "▶️ Run" button to see result.

💡 Read Hints
  • TypeVar with constraints might be a good fit for this challenge.
  • You can also try to solve this using the "Generic Functions" statement.