Skip to main content

Implement PartialByKeys

MIDDLE

Build PartialByKeys<T, K> where only selected keys K become optional and all other keys preserve original required/optional modifiers.

Example:

Input: value = 42
Output: 42

Write a clean implementation and validate it with the provided test cases.

Examples:

Input 1:{"value":1}
Output 1:1
Input 2:{"value":42}
Output 2:42

Loading editor...

Run your code to see results

Click the Run button above