the problem can not be solved by just making a FA , and those who are making seems to misunderstood that a FA (dfa and nfa ) are not capable of counting. the only version of FA capable of counting number of occurence of string is TRANDUCERS ( mealy and moore ).
further the question can only be answered by making a transducer, see below the moore machine : https://ibb.co/Wgmwvkm
edit : the above question can be given by DFA also , i thought of counting only ( my bad ) , please look here https://ibb.co/4t9sXvq