You are given four integers. Your task is to determine and return the second smallest value among them.
The numbers may contain duplicates, so the second smallest value can be equal to the smallest value if the minimum occurs more than once.
Input: a = 3, b = 9, c = 7, d = 5
Output: 5
Explanation: The smallest value is 3, and the second smallest value is 5.
Input: a = 2, b = 2, c = 8, d = 6
Output: 2
Explanation: The smallest value 2 occurs twice, so the second smallest value is also 2.
Input: a = 4, b = 3, c = 2, d = 1
Output: 2
Explanation: The numbers in ascending order begin with 1, 2, making 2 the second smallest value.
Sign in to write, run, and submit your solution against the full test suite.