185k views
4 votes
If the input is: crash crush, what is the output?

1) 2 characters match
2) 3 characters match
3) 4 characters match
4) 5 characters match

User Fonebone
by
8.2k points

1 Answer

2 votes

Final answer:

By comparing 'crash' and 'crush', we find that four characters ('c', 'r', 's', 'h') match in the same positions in both words. Therefore, the output is 3) 4 characters match.

Step-by-step explanation:

To determine how many characters match between the input strings "crash" and "crush", we need to compare the characters of the two words in the same positions. Looking at each position:

  • The first character 'c' is the same in both words.
  • The second character 'r' is also the same.
  • The third character 'a' in "crash" and 'u' in "crush" do not match.
  • The fourth character 's' is the same in both words.
  • The fifth character 'h' is the same as well.

So there are 4 characters that match between "crash" and "crush". The correct answer is 3) 4 characters match.

User Hinekyle
by
8.2k points