• + 0 comments

    My test case 4 is failing for some reason.. coz when i run it on my local machine with the same input, it works but HackerRank is not accepting my code. This is my code:

    import re
    
    regex = r"(#[0-9a-fA-F]{6})|(#[0-9a-fA-F]{3})"
    res = []
    
    n = int(input())
     
    while n > 0:
         css = input().split()
         if len(css) < 2:
             pass
         else:
             for item in css:
                 m = re.findall(regex, item)
                 if m:
                     res += m
         n -= 1
    
    for element in res:
         for code in element:
             if code != '':
                 print(code)