Marks :100
: 1 | : 0
Given the list of string representing each order from 2 customers and each character in the order representing an item, find if the orders were similar.
Condition for being similar Should be the same length and the number of distinct characters should not be more than 3
The first line of each test case contains a string of words separated by space name customer1 ($$$1 \le customer1 \le 100$$$).($$$1 \le customer1_i \le 1000$$$). The next line contains string of words separated by space name customer2 ($$$1 \le customer2 \le 100$$$).($$$1 \le customer2_i \le 1000$$$).
For each test case print capital YES if ($$$ customer1_i $$$) order for customer 1 is similar to customer 2($$$ customer2_i $$$) else print capital NO.
nnbnnb ammxdf bbncbb aecdx
YES NO
X: ["nnbnnb","ammxdf"]
y: ["bbncbb","aecxdf"]
Output : ["YES","NO"]
x[0] is similar to y[0] as both same in length and
x[0] has 4"n", y[0] has 1 n,so delta is 1.
x[0] has 2 "b", y[0] has 4 "b" so delta is 2.
x[0] has 0 "c", y[0] has 1 "c" so delta is 1.
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.