Abinoam Jr. wrote in post #1136118:
> Dear Arup,

>
> # All the part from 3.times do block on got substituted.
> # Now is easy to figure out that the first return is also redundant
>
> def del_first_three(a)
>   num_to_del = a.find { |e| a.count(e) >= 3 }
>   a.delete_if { |e| e == num_to_del }
> end
>

Nice re-factoring. But the point is, I want to delete first 3 
duplicates. But `a.delete_if { |e| e == num_to_del }` will delete all 
the elements, which has occurrence 3 or more than 3.

My point is if any element occurs 4 times, I would delete only first 3 
occurrence.

-- 
Posted via http://www.ruby-forum.com/.