Simply we can do it like this
Take an array of index a to z and initialize value of each element as 0
Then, Compare each element of 1st string with array elements
Where u got a match , make value as +1 for that element
Now compare the second string and make when get a match, make that element-1
Like that, if all letter of 1st string match with letters of 2nd string, finally value of all array element will be 0