PHP, 195 bytes
Added the > 2 character restriction:
<?$a=$argv[1];$r=substr($a,-2,1)=="\n"?strrev($a):$a;foreach(explode("\n",$r)as$l){$s=strlen($l);
$x[$s]=++$i;$m=$i==$s?T:M;}$z=count($x);echo$i*$z>2?$z==1&&key($x)==$i?S:($z==1 && $i>2?R:$m):M?>
The upside down triangle adds an expensive 56 bytes to this!
Outputs are S,R,T,M
Saved a few bytes thanks to Dom Hastings. Wasted a couple to make it shapely ;)
Dave
- 161
- 4