A Sample PHP program for reference work( taking input ,creating arrays )

<?php fscanf(STDIN, "%d\n", $test); while($test--) { $ooo=array(); for($i=0;$i<26;$i++) $ooo[$i]=0; fscanf(STDIN, "%s\n", $raa); $qwe=0; $p=strlen($raa); for($i=0;$i<$p;$i++) { $w=ord($raa[$i]); $qwe= $w-97; $ooo[$qwe]=$ooo[$qwe]+1; } $f=0; $c=0; for($i=0;$i<26;$i++) { if($ooo[$i]%2!=0) { $f=1; $c++; } } if($f==0) { echo"Yes"; } else if($f==1 && strlen($raa)%2==1 && $c==1) { echo "Yes"; } else { echo "No"; } echo "<br>"; }

Comments

Popular posts from this blog

Getting Started With MEAN App Development with AngularJs , ExpressJs , NodeJs and MongoDB.

B. Dreamoon and WiFi :calculate no. of ways : recursive solution (branch and bound )

A. Dreamoon and Stairs : minimum steps to reach : recursion solution.