?php
global $result;
//Init module if you need
function Init(){
global $result;
$result = [];
}
//Insert one char from stringstream
function Insert($ch)
{
global $result;
// write code here
if(isset($result[$ch])){
$result[$ch]++;
}else{
$result[$ch] =1;
}
}
//return the first appearence once char in current stringstream
function FirstAppearingOnce()
{
global $result;
foreach($result as $k =>$v){
if($v ==1){
return $k;
}
}
return "#";
}