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
  • Apply
  • Hiring developers?
  1. Prepare
  2. Python
  3. Strings
  4. Merge the Tools!
  5. Discussions

Merge the Tools!

Problem
Submissions
Leaderboard
Discussions
Editorial

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

  • abhishekrathod22
    4 months ago+ 0 comments

    l = len(string) // k print(l)

    for i in range(0, len(string), k):
        s = ''
        s += string[i]
        g=0
    
        for j in range(i + 1, i + k):
            c = False
            g += 1
            for h in range(g):
    
                if string[j:j + 1] != string[i + h]:
                    c = True
    
                else:
                    c = False
                    break
            if c:
                s += string[j:j + 1]
        print(s)
    
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy