hackerrank.com

Practice>Python>Itertools>Iterables and Iterators

건이두 2019. 3. 4. 13:15
728x90

Iterables and Iterators

Problem link : https://www.hackerrank.com/challenges/iterables-and-iterators/problem
Difficulty : Medium

Tip

  • As we can see from problem description, it's regarding combination
  • We might be confused a bit due to that 'a' is appeared only once, or multiple
  • If 'a' appeared only once, we can resolve it simply
  • However, a appeared in multiple times
  • we should generate all combination
  • and check each one have 'a' or not
  • Don't worry, combonation in itertools, will generate all of possible combination

Solution


728x90