hackerrank.com

hackerrank.com Practice>Python>Itertools>Compress the String!

건이두 2019. 2. 7. 21:43
728x90

Compress the String!


Tip

  1. This is quite simple problem if you understand how to use groupby()
    1. Focus two variables(k and g) are iterated from groupby()
    2. As an example groupby('aaabb'),  g is 'aaa', and k is 'a'

Solution



728x90