[Solved] strncmp don’t work as it should

strcmp & strncmp functions return 0 if strings are equal. You should do: if (strncmp(frase1, frase3, 4) == 0) … i.e.: char *str1 = “Example 1”; char *str2 = “Example 2”; char *str3 = “Some string”; char *str4 = “Example 1”; if (strncmp(str1, str2, 7) == 0) printf(“YES\n”); // “Example” <-> “Example” else printf(“NO\n”); if … Read more

[Solved] fastest way to compare string elements with each other

The amount of downvotes is crazy but oh well… I found the reason for my performance issue / bottleneck thanks to the comments. The second for loop inside StartSimilarityCheck() iterates over all entries, which in itself is no problem but when viewed under performance issues and efficient, is bad. The solution is to only check … Read more

[Solved] I have given nested list accessing via for loop, but I can’t getting result?

patientsList = [[‘sagar’,’9856782311′],[‘mahsh’,’7865423158′]] search = input(“Enter mobile number of patient to search: “) for patient in patientsList: ”’ patient looks like this [‘sagar’,’9856782311′] patient[0] is the name patient[1] is the phone number ”’ if search == patient[1]: print(“Required patient is”) print(patient) print(“is Appointed”) break 9 solved I have given nested list accessing via for loop, … Read more