Question d’entretien chez HubSpot

Algorithm - given a string as an input, return the most frequently occurring substring of length n For example, input: 'inengineering', n = 2 output: 'in'