Iterate through the array while tracking What index has the lowest value and what that value is.
IE:
index: 0 - 1 - 2 - 3
Value: 4 - 2 - 5 - 1
0 = 4 - automatically the lowest, its the only other
1 = 2 if 2 < 4 set 1 lowest - true
2 = 5 if 5 <2 set 2 lowest - false
3 = 1 if 1 < 2 set 3 lowest - true
add value to index 3
Sidenote:
if you want to have different requirements for weapons (Different Clip sizes) you should set each value with the % full instead of the number of bullets.
3 rockets where you can hold 4 = 75% full.
4 minigun bullets where you can hold 100 = 4% full.
Choose minigun.