I have array data like this
I want to add new key expected_count to the array with if conditional,
if flags key == is_join ? expected_count=2
if flags key == is_grade ? expected_count=1
So the result will be like this
How the best way to do this?

