Given a sorted array `nums` and a `target` value, return the number of times the target appears in the array. If the target is not found, return 0.
{
"nums": [
5,
7,
7,
8,
8,
10
],
"target": 8
}2{
"nums": [
5,
7,
7,
8,
8,
10
],
"target": 6
}0{
"nums": [],
"target": 0
}0Sign in to Run Code and Submit