generate functionThu, 22 Dec 2022

write a function to receive a whole number and return the max digit

int maxDigit(int testnum) => testnum.ToString().Max(a => (int)char.GetNumericValue(a));

Want to kickstart your project?Use the new AI Studio to create your code