Try with this ARRAY formula.

=if(b2=min(if($a$2:$a$100=a2;$b$2:$b$100));1;0)

UNTESTED