Driver Code
$ a = " aaba " ; $ b = " abaa " ; if ( areEquivalent ( $ a , $ b ) ) echo " YES " , " STRNEWLINE " ; else echo " NO " , " STRNEWLINE " ; $ a = " aabb " ; $ b = " abab " ; if ( areEquivalent ( $ a , $ b ) ) echo " YES " , " STRNEWLINE " ; else echo " NO " , " STRNEWLINE " ; ? >