You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
returnStream.of(Arguments.of(newint[] {1,2,3,3,4,5},3,4,"Count of elements less than existing key"),Arguments.of(newint[] {1,2,3,3,4,5},4,5,"Count of elements less than non-existing key"),Arguments.of(newint[] {1,2,2,3},5,4,"Count with all smaller elements"),
33
33
Arguments.of(newint[] {2,3,4,5},1,0,"Count with no smaller elements"),Arguments.of(newint[] {},1,0,"Count in empty array"));
34
34
}
35
+
36
+
@ParameterizedTest(name ="Edge case {index}: {3}")
returnStream.of(Arguments.of(newint[] {5,5,5,5,5},5,newint[] {0,4},"All elements same as key"),Arguments.of(newint[] {1,2,3,4,5},1,newint[] {0,0},"Key is first element"),Arguments.of(newint[] {1,2,3,4,5},5,newint[] {4,4},"Key is last element"),
44
+
Arguments.of(newint[] {1,2,3,4,5},0,newint[] {-1, -1},"Key less than all elements"),Arguments.of(newint[] {1,2,3,4,5},6,newint[] {-1, -1},"Key greater than all elements"),
45
+
Arguments.of(newint[] {1,2,2,2,3,3,3,4},3,newint[] {4,6},"Multiple occurrences spread"),Arguments.of(newint[] {2},2,newint[] {0,0},"Single element array key exists"),Arguments.of(newint[] {2},3,newint[] {-1, -1},"Single element array key missing"));
46
+
}
47
+
48
+
@ParameterizedTest(name ="Edge case {index}: {3}")
returnStream.of(Arguments.of(newint[] {1,2,3,4,5},0,0,"Key less than all elements"),Arguments.of(newint[] {1,2,3,4,5},6,5,"Key greater than all elements"),Arguments.of(newint[] {1},0,0,"Single element greater than key"));