printResult<T> function
Helper function to print the result for a list of generic elements.
Implementation
void printResult<T>(List<T> input) {
final result = firstNonRepeatedElement(input);
if (result != null) {
print("First non-repeated element in $input is: '$result'");
} else {
print("No non-repeated element found in $input");
}
}