freeCodeCamp/curriculum/challenges/spanish/08-coding-interview-prep/project-euler/problem-41-pandigital-prime...

1.2 KiB

id challengeType title videoUrl localeTitle
5900f3951000cf542c50fea8 5 Problem 41: Pandigital prime Problema 41: Pandigital prime

Description

Diremos que un número de n dígitos es pandigital si hace uso de todos los dígitos 1 a n exactamente una vez. Por ejemplo, 2143 es un pandigital de 4 dígitos y también es primo. ¿Cuál es el mayor número primo n Pandigital -Longitud dígitos que existe?

Instructions

Tests

tests:
  - text: <code>pandigitalPrime(4)</code> debe devolver 4231.
    testString: 'assert(pandigitalPrime(4) == 4231, "<code>pandigitalPrime(4)</code> should return 4231.");'
  - text: <code>pandigitalPrime(7)</code> debe devolver 7652413.
    testString: 'assert(pandigitalPrime(7) == 7652413, "<code>pandigitalPrime(7)</code> should return 7652413.");'

Challenge Seed

function pandigitalPrime(n) {
  // Good luck!
  return n;
}

pandigitalPrime(7);

Solution

// solution required