We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Python
  3. Regex and Parsing
  4. Hex Color Code
  5. Discussions

Hex Color Code

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • mars_09galaxy
    3 months ago+ 0 comments

    python3

    s=''''''
    for _ in range(int(input())):
        s=s+input()+'\n'
    mat = re.findall(r'#[a-fA-F0-9]{3,6}\s{0,}[,);]',s)   
    for i in mat:
        if ';' or ',' or ')' or '\n' in i:
            a=i.strip(";),\n")
            print(a)
    
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy