text: /**
   * Given some integer, find the maximal number you can obtain
   * by deleting exactly one digit of the given number.
   *
   * @param {Number} n
   * @return {Number}
   *
   * @example
   * For n = 152, the output should be 52
   *
   */
  function deleteDigit(n) {
    const digitArray = String(n).split('').map(Number);
    return Math.max(
      ...digitArray.map((el, i) => {
        const maxDigit = digitArray.slice();
        maxDigit.splice(i, 1);
        return Number(maxDigit.join(''));
      }),
    );
  }
  
  module.exports = deleteDigit;
  