Your question is Top Training Patterns from Inputs. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an array of strings inputs, where each string represents one user input, and an integer k, return the k most frequently occurring training patterns. A pattern is the normalized form of each input after trimming leading/trailing spaces and converting to lowercase. If two patterns have the same frequency, return them in lexicographical order.
def top_training_patterns(inputs, k):