Python HackerRank|Word Order(OrderedCounter)(from collections import Counter, OrderedDict)

  1. Dashboard 
  2.  Python 
  3.  Collections 
  4.  Word Order
    1. from collections import Counter, OrderedDict
      
      class OrderedCounter(Counter, OrderedDict):
          pass
      
      n = int(input())
      od = OrderedCounter(input() for _ in range(n))
      
      print(len(od))
      print(*od.values())


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章