How to check equality of two String objects independent of the char order?
Examples:
checkEq(A*B'*C,B'*A*C) has to return true
checkEq(A*B'*C,A*B*C) ----> false... etc
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try using the java
str.splitmethod. For instance,str.split("*")will give you an array of the elements A,B,C or B,A,C. And then just sort them and single loop through them once to compare them.