A sensor reading may optionally be passed through a filtering step.
You must create a function that:
Filtering Behavior
Implement filtering as follows:
NONE (default) → return the raw value unchangedLOW → return raw / 2 (basic smoothing)HIGH → return raw / 4 (strong smoothing)All divisions use integer division.
Filter modes must be represented using an enum, not integers.
Program Behavior (main)
raw and an integer modeFlag.modeFlag == 0:modeFlag == 1:LOW" or "HIGH").Assume all inputs are valid.
Example 1
Input:
100 0Output:
100
Example 2
Input:
100 1 LOWOutput:
50
Example 3
Input:
100 1 HIGHOutput:
25
Constraints
Input
100 0
Expected Output
100