Why python 1/2/3 liners so attractive?
1/2/3 liners solutions could be just for fun, but they are not good tutorials.\nWhy those are always the top preferred python solutions?\nMy only funny conclusi
1/2/3 liners solutions could be just for fun, but they are not good tutorials.\nWhy those are always the top preferred python solutions?\nMy only funny conclusion is: most people practice leetcode also just for fun : )\n\n```\ndef maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n    return max([freq for subs,freq in Counter(s[i:i+minSize] for i in range(len(s)-minSize+1)).items() if len(set(subs)) <= maxLetters] + [0])\n```\n\n\n```\ndef maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) -> int:\n\tcnt = Counter()\n\tfor i in range(len(s)-minSize+1):\n\t\tsubs = s[i:i+minSize]\n\t\tcnt[subs] += 1\n\n\tmaxfreq = 0\n\tfor subs,freq in cnt.items():\n\t\tif len(set(subs)) <= maxLetters:\n\t\t\tmaxfreq = max(maxfreq, freq)\n\n\treturn maxfreq\n```
[]