I was trying to make a code working like Array.prototype.indexOf with big O(n). it is how I calculate Big O of my code. is it right?
n = haystack.length when