they are both O(n) algorithms
# suitescript
c
they are both O(n) algorithms