<commit_before>package leetcode;

/**
 * https://leetcode.com/problems/count-substrings-that-differ-by-one-character/
 */
public class Problem1638 {
    public int countSubstrings(String s, String t) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1638 prob = new Problem1638();
        System.out.println(prob.countSubstrings("aba", "baba")); // 6
        System.out.println(prob.countSubstrings("ab", "bb")); // 3
        System.out.println(prob.countSubstrings("a", "a")); // 0
        System.out.println(prob.countSubstrings("abe", "bbc")); // 10
        System.out.println(prob.countSubstrings("computer", "computation")); // 90
    }
}<commit_msg>Update problem 1638<commit_after>package leetcode;

/**
 * https://leetcode.com/problems/count-substrings-that-differ-by-one-character/
 */
public class Problem1638 {
    public int countSubstrings(String s, String t) {
        int answer = 0;
        int minLength = Math.max(s.length(), t.length());
        for (int length = 1; length <= minLength; length++) {
            for (int i = 0; i <= s.length() - length; i++) {
                String sub1 = s.substring(i, i + length);
                for (int j = 0; j <= t.length() - length; j++) {
                    String sub2 = t.substring(j, j + length);
                    int count = 0;
                    for (int k = 0; k < length; k++) {
                        if (sub1.charAt(k) != sub2.charAt(k)) {
                            count++;
                        }
                        if (count > 1) {
                            break;
                        }
                    }
                    if (count == 1) {
                        answer++;
                    }
                }
            }
        }
        return answer;
    }

    public static void main(String[] args) {
        Problem1638 prob = new Problem1638();
        System.out.println(prob.countSubstrings("aba", "baba")); // 6
        System.out.println(prob.countSubstrings("ab", "bb")); // 3
        System.out.println(prob.countSubstrings("a", "a")); // 0
        System.out.println(prob.countSubstrings("abe", "bbc")); // 10
        System.out.println(prob.countSubstrings("computer", "computation")); // 90
    }
}
{'fraction_non_alphanumeric': 0.1514486391571554, 'fraction_numerical': 0.024143985952589993, 'mean_word_length': 1.6623831775700935, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3385947', 'n_tokens_mistral': 708, 'n_tokens_neox': 648, 'n_words': 141}