What is the big Oh of the following code snippet?

for(int i = 0; i < n; i++){
  for(int j = 0; j < n; j++){
    if(candy.getFrequencyOf(favorites[j]) == i){
      return favorites[j];
    }
  }
}
O(n^3)
  • O(j)
  • O(n)
  • O(n^2)

There are no hints for this question