Refactored all solutions

This commit is contained in:
rshaghoulian
2017-04-05 18:42:35 -05:00
parent 5f4c2f4a78
commit decc8e791e
135 changed files with 848 additions and 849 deletions
+2 -3
View File
@@ -6,15 +6,14 @@ import java.io.*;
import java.util.*;
public class Solution {
/* Runtime: O(n) using a HashMap */
// Time Complexity: O(n) using a HashMap
// Space Complexity: O(n)
static boolean isAnagram(String a, String b) {
if (a == null || b == null || a.length() != b.length()) {
return false;
}
a = a.toLowerCase();
b = b.toLowerCase();
HashMap<Character, Integer> map = new HashMap<>();
/* Fill HashMap with 1st String */