Simplifying boolean returns (#3796)

* Simplifying boolean returns

* add comment back
This commit is contained in:
Nathan Cheshire
2022-12-17 21:03:09 -06:00
committed by GitHub
parent fb09eb289e
commit c6694fc1bd
3 changed files with 6 additions and 25 deletions

View File

@ -56,11 +56,8 @@ public class Anagrams {
Arrays.sort(
d
);/* In this approach the strings are stored in the character arrays and both the arrays are sorted. After that both the arrays are compared for checking anangram */
if (Arrays.equals(c, d)) {
return true;
} else {
return false;
}
return Arrays.equals(c, d);
}
}