Handling second demensional array

Hi all devils!!
How are you.
Yas is reactivated finally :)

Today I tried some tricky situation.

I needed to compact second dimensional array, which includes some id's and other elements.

Using id and detect the target elements and remove them.
Oh my English is getting worse day by day...
But I believe code talks everything instead of me :)
Ok today's small piece of Ruby code is following

  1. #Compact the second demencional array
  2. arr = [[0,"miyake","password"],[1,"miyake","hoge"],[2,"hoge","hoge"]]
  3. @target = 0
  4. arr.each {|a|
  5. if a[0] == @target
  6. arr[@target] = nil
  7. end
  8. }
  9. p arr.compact

Enjoy if you have some comment or any more great idea!!
Please share with us! Thanks from Japan!