English, asked by harshidanthuluri, 8 months ago

Input Format First line contains one integer N, which denotes the number of brides and grooms taking part in the swayamvar. Second line contains a string in lowercase, of length N containing initial state of brides-to-be. Third line contains a string in lowercase, of length N containing initial state of grooms-to-be. Each string contains only lowercase 'r' and 'm' stating person at that index drinks "rum"(for 'r') or mojito(for 'm'). Output Output a single integer denoting the number of pairs left unmatched. Timeout 1 Explanation Example 1 Input 4 rrmm mrmr Output 0 Explanation The bride at first place will only marry groom who drinks rum. So the groom at first place will join the end of the queue. Updated groom's queue is "rmrm". Now the bride at first place will marry the groom at first place. Updated bride's queue is "rmm" and groom's queue is "mrm". The process continues and at last there are no pairs left. So answer is 0. Example 2 Input 4 rmrm mmmr Output 2

Answers

Answered by akshi21
0

nnd   vd   vv bfebbfhbh lkn mdj n, fjn fhejfjie cjaonf dExplanation:

Similar questions