Difficulty Level: Basic

Total Submissions: 413 Accuracy:


Just One Mismatch

Given a string and array of strings, find whether the array contains a string with one character difference from the given string. Array may contain strings of different lengths.


Input : str = "banana"
        arr[] = {"bana", "apple", "banaba", bonanzo", "banamf"}
Output :True
Explanation:Only one character difference between banana and banaba

Example : 
Input : 
The first line of input contains an integer T denoting the Test cases. Then T test cases follow. 
Second line contains No. of elements in arr[] - N
Third line contains a[i] elements
Fourth line contains string - str

Output : 
True if there is only one mismatch(by character), else False

Constraints :
1 ≤ T ≤ 50
1 ≤ N ≤ 100
1 ≤ arr[i] ≤ 1000

Input : 
gold flow cood code

Output : 


** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Mohit Gupta_OMG :D

Set Default Code

It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use, generate link and share the link here.