#C163. Language Count Summary

    ID: 44856 Type: Default 1000ms 256MiB

Language Count Summary

Language Count Summary

You are given a list of repository languages for a GitHub user. Each repository is associated with a programming language. Some repositories may not have a language specified, in which case they are represented as "None". Your task is to count the occurrences of each language (ignoring entries that are "None") and output the result as a JSON object (i.e. a dictionary) where the keys are the language names and the values are their respective counts. The keys in the output JSON object must be in lexicographical order.

Note: Instead of fetching data from GitHub, the input is provided through standard input, and you must format your output to standard output exactly as specified.

inputFormat

The first line contains an integer n, which represents the number of repositories. Each of the following n lines contains a string that indicates the language used in that repository. The string "None" indicates that the repository does not have a specified language.

outputFormat

Output a JSON object (dictionary) where each key is a language and the corresponding value is the count of repositories using that language. The keys in the JSON object must be sorted in lexicographical order. If no repository has a language (i.e. all inputs are "None" or if there are no repositories), output an empty JSON object {}.## sample

5
Python
JavaScript
Python
JavaScript
Java
{"Java":1,"JavaScript":2,"Python":2}