Sorry for the newbie question.
So i had 2 different transactions with the same gas price and same function called
But it used different amount of gas unit (not gas price)
https://bscscan.com/tx/0x67f844f7bbb5b268b8457ee5de16d52f96f67c94368c62f31cbfa19c3a76cc9e
https://bscscan.com/tx/0xd899172f4c00b536ba17829a5cf435a5188cea9c44a1fe43adb36b6afe8d1dd3
Is there any factor which affect gas cost, or any method or equation to estimate this?