I hope this will help you understand why the answer is 4.
100% Decision coverage


The code traverses 4 paths/decisions for 100% Decision coverage.
This happens when the decision statements are nested. In this case
"height > width
" with execute only if "width > length
" is true.
"height > length
" with execute only if "width > length
" is false.
Hence the minimum number of test cases required to cover 100% decision testing is 4.
Edit: As per Polina's request I'm adding explanation for 100% Statement Coverage.
For this same piece of code you can achieve 100% Statement Coverage with just 2 sets of inputs,
Case 1.
Height = 10
Width = 8
Length = 5
In this case,
if width > length
will be true. Hence next statement
biggest_dimension = width
will be executed.
if height > width
will also be true. Hence next statement
biggest_dimension = height
will be executed.
Case 2.
Height = 7
Width = 5
Length = 6
In this case,
if width > length
will be false. Hence next statement biggest_dimension = length
will be executed.
if height > length
will be true. Hence next statement biggest_dimension = height
will be executed.
So you need a minimum of 2 tests for 100% Statement Coverage.