-
hackerrank.com Practice>Python>Strings>Merge the Tools!hackerrank.com 2019. 2. 4. 20:16728x90
hackerrank.com Practice>Python>Strings>Merge the Tools!
Merge the Tools!
Tip
- We can solve this problem with set
- However, better way, is the using string replacement
- Substring as per the length of k
- input is s
- pick the first character, and replace it to ''
- s.replace(s[0])
- Now, duplication of first character is resolve
- To apply the way, to whole string, please see below
- s[0:j] + s1[j:].replace(s1[j-1], '')
Solution
728x90'hackerrank.com' 카테고리의 다른 글
hackerrank.com Practice>Python>Collections>Collections.namedtuple() (0) 2019.02.11 hackerrank.com Practice>Python>Collections>DefaultDict Tutorial (0) 2019.02.10 hackerrank.com Practice>Python>Itertools>Compress the String! (0) 2019.02.07 hackerrank.com Practice>Python>Sets>No Idea! (0) 2019.02.06 hackerrank.com Practice>Python>Strings>The Minion Game (0) 2019.02.04