there n house evenly line street house beautifully paint you give 0indexed integer array color length n colorsi represent color ith houseReturn maximum distance house different colorsThe distance ith jth house absi j absx absolute value x example 1input color 1116111output 3explanation in image color 1 blue color 6 redthe furth house different color house 0 house 3House 0 color 1 house 3 color 6 the distance abs0 3 3note house 3 6 produce optimal answerexample 2input color 18383output 4explanation in image color 1 blue color 8 yellow color 3 greenThe furth house different color house 0 house 4House 0 color 1 house 4 color 3 the distance abs0 4 4example 3input color 01output 1explanation the furth house different color house 0 house 1house 0 color 0 house 1 color 1 the distance abs0 1 1 Constraintsn colorslength2 n 1000 colorsi 100test datum generate house different color