freeCodeCamp/curriculum/challenges/arabic/08-coding-interview-prep/rosetta-code/top-rank-per-group.arabic.md

1.5 KiB

title id challengeType videoUrl localeTitle
Top rank per group 595011cba5a81735713873bd 5

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(typeof topRankPerGroup === "function", "<code>topRankPerGroup</code> is a function.");'
  - text: ''
    testString: 'assert(typeof topRankPerGroup(-1, []) === "undefined", "<code>topRankPerGroup</code> returns undefined on negative n values.");'
  - text: ''
    testString: 'assert.equal(res1[0][0].dept, "D050", "First department must be D050");'
  - text: ''
    testString: 'assert.equal(res1[0][1].salary, 21900, "First department must be D050");'
  - text: ''
    testString: 'assert.equal(res1[3][3].dept, "D202", "The last department must be D202");'
  - text: ''
    testString: 'assert.equal(res2[2].length, 1, "<code>topRankPerGroup(1, ...)</code> must return only top ranking result per group.");'
  - text: ''
    testString: 'assert.equal(res3[2][1].name, "Maze Runner", "<code>topRankPerGroup(1, ...)</code> must return only top ranking result per group.");'

Challenge Seed

function topRankPerGroup(n, data, groupName, rankName) {
  // Good luck!
  return true;
}

After Test

console.info('after the test');

Solution

// solution required