<jupyter_start><jupyter_text>Count Good TripletsGiven an array of integers arr, and three integers a, b and c. You need to find the number of good triplets.A triplet (`arr[i]`, `arr[j]`, `arr[k]`) is good if the following conditions are true:0 <= i < j < k < arr.length- `|arr[i] - arr[j]| <= a`- `|arr[j] - arr[k]| <= b`- `|arr[i] - arr[k]| <= c`Where |x| denotes the absolute value of x.Return the number of good triplets.  备注题目来源:[LeetCode - Count Good Triplets - 1534](https://leetcode.com/problems/count-good-triplets/)很简(wu)单(liao)的一道题目，可以直接暴力穷举并搜索即可。<jupyter_code>def countGoodTriplets(arr, a, b, c) -> int:
    count  = 0
    for i_idx in range(0,len(arr)):
        for j_idx in range(i_idx + 1,len(arr)):
            for k_idx in range(j_idx + 1,len(arr)):
                if abs(arr[i_idx] - arr[j_idx]) <= a and abs(arr[j_idx] - arr[k_idx]) <= b and abs(arr[i_idx] - arr[k_idx]) <= c:
                    count += 1
    return count
print(countGoodTriplets([3,0,1,1,9,7],7,2,3))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16879293424926398, 'fraction_numerical': 0.018645731108930325, 'mean_word_length': 3.5945945945945947, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 6, 'https://': 1, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '325702', 'license': 'MIT', 'n_tokens_mistral': 434, 'n_tokens_neox': 421, 'n_words': 104, 'path': 'Count-Good-Triplets.ipynb', 'repo_name': 'AllenTom/Algorithm', 'size': '1019'}