Given an array of strings find the first pair of string which is repeated


#1

Given an array of strings find the first pair of string which is repeated


#2

consider my reply on this : - Find duplicate string


#3

it uses inbuilt data structure ,how to do it without using inbuilt hashmap and using just array


#4

$a = array(“tarun”,“don”,“mukul”,“tarun1”,“mukul”);
$c = array();

for($i = 0;$i<count($a);++$i)
{
if(!isset($c[$a[$i]]))
{
$c[$a[$i]] = $a[$i];
}

else
{
    var_dump($c[$a[$i]]);
    exit;
}

}

//var_dump($c);