problem in my code

please what’s the problem in my code (ruby)

tab1 = [1,2,88,42,99]
tab2 = []

tab1.each do |t|
  if t == 42
    break
  end
  puts t
end

This might possible be for TEST

The set given in example is sample input, test cases involve different numbers & not the only set given as example. Hope you got it. Now, you can correct it all by yourself.

3 Likes