Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

1000 B

id, title, challengeType, dashedName
id title challengeType dashedName
68d30845cc08266018fc46be Challenge 78: Integer Sequence 28 challenge-78

--description--

Given a positive integer, return a string with all of the integers from 1 up to, and including, the given number, in numerical order.

For example, given 5, return "12345".

--hints--

sequence(5) should return "12345".

assert.equal(sequence(5), "12345");

sequence(10) should return "12345678910".

assert.equal(sequence(10), "12345678910");

sequence(1) should return "1".

assert.strictEqual(sequence(1), "1");

sequence(27) should return "123456789101112131415161718192021222324252627".

assert.equal(sequence(27), "123456789101112131415161718192021222324252627");

--seed--

--seed-contents--

function sequence(n) {

  return n;
}

--solutions--

function sequence(n) {
  let result = "";
  for (let i = 1; i <= n; i++) {
    result += i;
  }
  return result;
}