<?php
function calculatescore($x) {
return [
substr_count($x, 'Y'), //substr_count-Counts how many times this data is given
substr_count($x, 'O'),
substr_count($x, 'U')
];
}
print_r (calculatescore("YOU")); // 1,1,1
print_r (calculatescore("YYOOUU)); //2,2,2
print_r (calculatescore("UUUOOYYYY)); //3,2,4