GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday, 10 June 2022

[Solution] Equal Strings CodeChef Solution | CodeChef Problem Solution 2022

Given a string A of length N consisting of lowercase English alphabet letters.

You are allowed to perform the following operation on the string A any number of times:

  • Select a non-empty subsequence S of the array [1,2,3,,N] and any lowercase English alphabet α;
  • Change Ai to α for all iS.

Find the minimum number of operations required to convert A into a given string B of

    Solution Click Below:-  CLICK HERE


     length N consisting of lowercase English alphabet letters.

    Input Format

    • The first line of input contains a single integer T, denoting the number of test cases. The description of T test cases follow.
    • The first line of each test case contains an integer N - the length of the string A and B.

    • The second line of each test case contains the string A.
    • The third line of each test case contains the string B.

    Output Format

    For each test case, output the minimum number of operations required to convert string A into string B.

    Constraints

    No comments:

    Post a Comment