You are given an 8-bit register. Set all bits between position start and end (inclusive).Use 0-based indexing and assume start <= end.
Example 1
Input: reg = 0b00000000, start = 1, end = 3 Output: 0b00001110
Example 2
Input: reg = 0b00001000, start = 0, end = 2 Output: 0b00001111
Example 3
Input: reg = 0b00000001, start = 3, end = 5 Output: 0b00111001
Test Cases
Test Results
Input
0 1 3
Expected Output
14