Sort by

recency

|

608 Discussions

|

  • + 0 comments
    #Here is the code
    for _ in range(n):
        matrix_item = input()
        matrix.append(matrix_item)
    st1 = ""
    for j in range(len(matrix[0])):
        for i in matrix:
            st1 += i[j]
        st1 += ''
    s = re.sub(r'(?<=\w)[\s\W_]+(?=\w)', ' ', st1, flags=re.ASCII)
    
  • + 1 comment

    Is there a bug here for this challenge? i have code very similar to others here, and my output matches the expected output, I copied the string and searched for the string in my browser and both outputs highlight so they are the same. I'm confused why my answer is not being accepted

  • + 0 comments

    regular expressions are for regular people.

  • + 0 comments
    decoded_script = ""
    for j in range(m):
        for i in range(n):
            decoded_script += matrix[i][j]
        
    print(re.sub(r"(?<=[a-zA-Z])[^a-zA-Z]+(?=[a-zA-Z])", " ", decoded_script))
    
  • + 0 comments
    import math
    import os
    import random
    import re
    import sys
    
    
    s=str()
    l=list()
    size=input().split()
    n=int(size[0])
    m=int(size[1])
    for _ in range(n):
        a=input()
        l.append(a)
    for j in range(m):
        for i in l:
            s+=i[j]
    r=re.sub(r"(?<=[a-zA-Z])[^a-zA-Z]+(?=[a-zA-Z])"," ",s)
    print(r)