mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-21 02:53:15 +08:00
Simplifying boolean returns (#3796)
* Simplifying boolean returns * add comment back
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user