BETA Can't read the text? Switch theme 4. Group Division A university has admitted a group of n students with varying sk
Posted: Thu May 05, 2022 12:49 pm
solve in java 8 in 30 minutes
solve in java 8
BETA Can't read the text? Switch theme 4. Group Division A university has admitted a group of n students with varying skill levels. To better accommodate the students, the university has decided to create classes tailored to the skill levels. A placement. examination will return a skill level that will be used to group the students, where levels represents the skill level of student i. All students within a group must have a skill level within maxSpread, a specified range of one another. Determine the minimum number of classes that must be formed. Example n=5 levels = [1, 4, 7, 3, 4] maxSpread=2 The students in any group must be within maxSpread = 2 levels of each other. In this case, one optimal grouping is (1, 3), (4, 4), and (7). Another possible grouping is (1), (3, 4, 4), (7). There is no way to form fewer than 3 groups. Function Description Complete the function groupDivision in the editor below. groupDivision has the following parameter(s): int levels[n]: the skill level for each student ✪ Info C# Autocomplete Ready Ⓒ 1 > using System. CodeDom. Compiler; 16 class Result 17 { 18 19 /* 20 Complete the groupDivision function below. 21 22 * The function is expected to return an INTEGER. 23 The function accepts following parameters: 24 ★ 1. INTEGER ARRAY levels. 25 2. INTEGER maxSpread 26 Test Results Custom Input Compiled successfully. All available test cases passed Test case 0 Input (stdin) Test case 1 1 2 3 Test case 2 4 Test case 3 8 & Test case 4 8 8 7 Run Code 3 ⠀ Line: 16 Col: 1 Submit Run Tests Run as Custom Input | Download
solve in java 8
BETA Can't read the text? Switch theme 4. Group Division A university has admitted a group of n students with varying skill levels. To better accommodate the students, the university has decided to create classes tailored to the skill levels. A placement. examination will return a skill level that will be used to group the students, where levels represents the skill level of student i. All students within a group must have a skill level within maxSpread, a specified range of one another. Determine the minimum number of classes that must be formed. Example n=5 levels = [1, 4, 7, 3, 4] maxSpread=2 The students in any group must be within maxSpread = 2 levels of each other. In this case, one optimal grouping is (1, 3), (4, 4), and (7). Another possible grouping is (1), (3, 4, 4), (7). There is no way to form fewer than 3 groups. Function Description Complete the function groupDivision in the editor below. groupDivision has the following parameter(s): int levels[n]: the skill level for each student ✪ Info C# Autocomplete Ready Ⓒ 1 > using System. CodeDom. Compiler; 16 class Result 17 { 18 19 /* 20 Complete the groupDivision function below. 21 22 * The function is expected to return an INTEGER. 23 The function accepts following parameters: 24 ★ 1. INTEGER ARRAY levels. 25 2. INTEGER maxSpread 26 Test Results Custom Input Compiled successfully. All available test cases passed Test case 0 Input (stdin) Test case 1 1 2 3 Test case 2 4 Test case 3 8 & Test case 4 8 8 7 Run Code 3 ⠀ Line: 16 Col: 1 Submit Run Tests Run as Custom Input | Download