Understand what the interviewer is asking for by using test cases and questions about the problem. Established a set (2-3) of test cases to verify their own solution later. Established a set (1-2) of ...
a b a b a b sum 1 1 + 1 2 + 1 - (1) 2+1-(1oc)=2 2+1-1=2 2+1-1=2 11 so 1 + previous - how many rightshifts? ab, ba --> 5 a, b --> 6 total 11 ...
The substr_count() in php is a string function which counts the no of times the sub string occurred in the string. this function is case-sensitive. the syntax of the function is as : ...