STEP 5 – HINT 5

Below solution for two examples.