<jupyter_start><jupyter_text>Equivalent KeypressesHave the function EquivalentKeypresses(strArr) read the array of strings stored in strArr which will contain 2 strings representing two comma separated lists of keypresses. Your goal is to return the string true if the keypresses produce the same printable string and the string false if they do not. A keypress can be either a printable character or a backspace represented by -B. You can produce a printable string from such a string of keypresses by having backspaces erase one preceding character.For example: if strArr contains ["a,b,c,d", "a,b,c,c,-B,d"] the output should return true because those keypresses produce the same printable string. The array given will not be empty. The keypresses will only contain letters from the alphabet and backspaces.ExamplesInput: ["a,b,c,d", "a,b,c,d,-B,d"]Output: trueInput: ["c,a,r,d", "c,a,-B,r,d"]Output: false<jupyter_code>def EquivalentKeypresses(strArr):

  sp = []
  new = [[],[]]
  for i in range(len(strArr)):
    sp.append(strArr[i].split(','))

  t=0
  for j in sp:
    for k in j:
      if k != '-B':
        new[t].append(k)
        
      else:
        if len(new[t]) == 0:
          continue
        else:
          new[t].pop()
    if [''] in new:
      new[t].clear()
    t+=1

  if new[0]==new[1]:
    print('true')
  else:
    print('false')
  #print(new,'<-this')

# keep this function call here 
EquivalentKeypresses(input())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11616847826086957, 'fraction_numerical': 0.004076086956521739, 'mean_word_length': 3.7211538461538463, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '545841', 'license': 'MIT', 'n_tokens_mistral': 480, 'n_tokens_neox': 466, 'n_words': 170, 'path': 'coderbyte/20191227_1/Equivalent Keypresses.ipynb', 'repo_name': 'ZoeKuan/Coderbyte', 'size': '1472'}