Boolean expression is not evaluating correctly in java
class Solution { public long validSubstringCount(String word1, String word2) { HashMap<Character, Integer> map = new HashMap<>(); for (int i=0; i<word2.length(); i++) { char val = word2.charAt(i); if (!map.containsKey(val)) map.put(val,1); else map.put(val, map.get(val)+1); } HashMap<Character, Integer> run = new HashMap<>(); int runcount = 0; int start = 0; int end = 0; int ret = 0; […]