<jupyter_start><jupyter_text>Code Signal Rains of Reason  Array Replace (25)Given an array of integers, replace all the occurrences of elemToReplace with substitutionElem. ExampleFor inputArray = [1, 2, 1], elemToReplace = 1, and substitutionElem = 3, the output should besolution(inputArray, elemToReplace, substitutionElem) = [3, 2, 3].<jupyter_code>def arrayReplace(inputArray, elemToReplace, substitutionElem):
    l = []
    for i in range(len(inputArray)):
        if inputArray[i] == elemToReplace:
            l.append(substitutionElem)
        else: 
            l.append(inputArray[i])
    return l<jupyter_output><empty_output><jupyter_text>Even Digits Only (26)Check if all digits of the given integer are even. ExampleFor n = 248622, the output should besolution(n) = true;For n = 642386, the output should besolution(n) = false.<jupyter_code>def evenDigitsOnly(n):
    ## check if all digits in a number are even
    x = [int(a) for a in str(n)]
    t = 0
    for i in range(len(x)):
        if x[i] % 2 != 0:
            t = (t + 1)
        else:
            t = t
    if t == 0: return True; 
    else: return False<jupyter_output><empty_output><jupyter_text>Variable Name (27)Correct variable names consist only of English letters, digits and underscores and they can't start with a digit.Check if the given string is a correct variable name. ExampleFor name = "var_1__Int", the output should besolution(name) = true;For name = "qq-q", the output should besolution(name) = false;For name = "2w2", the output should besolution(name) = false.<jupyter_code>import string
def variableName(name):
    allowed = set(string.ascii_letters + string.digits + '_')
    return not name[0].isdigit() and all(char in allowed for char in name)<jupyter_output><empty_output><jupyter_text>Alphabetic Shift (28)Given a string, your task is to replace each of its characters by the next one in the English alphabet; i.e. replace a with b, replace b with c, etc (z would be replaced by a). ExampleFor inputString = "crazy", the output should be solution(inputString) = "dsbaz".<jupyter_code>import string
def alphabeticShift(inputString):
    word = []
    reg_alpha = string.ascii_letters
    for a in inputString:
        word.append(reg_alpha[reg_alpha.find(a)+1])
    return ''.join(word).lower()<jupyter_output><empty_output><jupyter_text>Chess Board Cell Color (29)Given two cells on the standard chess board, determine whether they have the same color or not. ExampleFor cell1 = "A1" and cell2 = "C3", the output should besolution(cell1, cell2) = true.<jupyter_code>def chessBoardCellColor(cell1, cell2):
    odd = ["1","3","5","7"]
    even = ["2","4","6","8"]
    col1 = ["A","C","E","G"]
    col2 = ["B","D","F","H"]
    ## white = col1 even, col2 odd
    ## black = col1 odd, col2 even
    white = []
    black = []
    index = [0,1,2,3]
    for num in index:
        for i in range(len(odd)):
            s = "".join((col1[i],odd[num]))
            black.append(s)
        for i in range(len(even)):
            s = "".join((col2[i],even[num]))
            black.append(s)
        for i in range(len(even)):
            s = "".join((col1[i],even[num]))
            white.append(s)
        for i in range(len(odd)):
            s = "".join((col2[i],odd[num]))
            white.append(s)
    if cell1 in white and cell2 in white:
        return True
    elif cell1 in black and cell2 in black:
        return True
    else:
        return False<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12176909821941413, 'fraction_numerical': 0.02125215393452039, 'mean_word_length': 3.348314606741573, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '638238', 'license': 'MIT', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1099, 'n_words': 359, 'path': 'CodeSignal/Arcade/Intro/06_Rains_of_Reason.ipynb', 'repo_name': 'caitlinkermen/Coding-Challenges', 'size': '3482'}