o Mall-Taral Sakshi (Contractor X ← → 44m left ALL ✪ 1 2 3 4 5 HackerRank Question Autoscel X - hackerrank.com/test/eifs
Posted: Thu May 05, 2022 12:48 pm
solve in java 8 in 20 minutes
solve in java 8
i am not getting full question because os some problems so please find question on your own i had only this screenshot and please send in java 8
i dont have full question please check on hackerrank you will get there full question please provide solution solve in java 8
o Mall-Taral Sakshi (Contractor X ← → 44m left ALL ✪ 1 2 3 4 5 HackerRank Question Autoscel X - hackerrank.com/test/eifsidn6q35/questions/1hp11c6d1fg BETA Can't read the text? Switch theme 3. Autoscale Policy A scaling computing system checks its average utilization every second while it monitors. It implements an autoscale policy to increase or reduce instances depending on the current load as described below. Once an action of increasing or reducing the number of instances is performed, the system will stop monitoring for 10 seconds. During that time, the number of instances does not change. • If the average utilization <25%, then an action is instantiated to reduce the number of instances by half if the number of instances is greater than 1. Take the ceiling if the number is not an integer. If the number of instances is 1, take no action. • If 25% ≤ average utilization s 60%, take no action. • If the average utilization > 60%, then an action is instantiated to double the number of instances if the doubled value does not exceed 2 * 10%. If the number of instances exceeds this limit upon doubling, take no action. Given an array of integers that represent the average utilization at each second, determine the number of instances at the end of the time frame. Example instances=2 C Learning Path Info D X ☆ * 0 1 ☀ Ⓒ I Line: 14 Col: 1 Run Tests Submit Run as Custom Input | Download 11@ Java 8 Autocomplete Ready Ⓒ 24 25 V 26 public static int finalInstances (int instances, List<Integer> averageUtil) { for (int i=0; i<averageUtil.size(); i++){ 27 V 28 29 if(averageUtil.get(i) < 25) { 30 V 31 32 if(instances!= 1 && (instances & 1) == 0) 33 V 34 35 instances = instances / 2; Test Results Custom Input Run Code Compiled successfully. All available test cases passed Test case 10 Input (stdin) Test case 118 1 1 2 3 Test case 12 8 3 5 4 10 Test case 13 5 88 Test case 14 8 Your Output (stdout)
solve in java 8
i am not getting full question because os some problems so please find question on your own i had only this screenshot and please send in java 8
i dont have full question please check on hackerrank you will get there full question please provide solution solve in java 8
o Mall-Taral Sakshi (Contractor X ← → 44m left ALL ✪ 1 2 3 4 5 HackerRank Question Autoscel X - hackerrank.com/test/eifsidn6q35/questions/1hp11c6d1fg BETA Can't read the text? Switch theme 3. Autoscale Policy A scaling computing system checks its average utilization every second while it monitors. It implements an autoscale policy to increase or reduce instances depending on the current load as described below. Once an action of increasing or reducing the number of instances is performed, the system will stop monitoring for 10 seconds. During that time, the number of instances does not change. • If the average utilization <25%, then an action is instantiated to reduce the number of instances by half if the number of instances is greater than 1. Take the ceiling if the number is not an integer. If the number of instances is 1, take no action. • If 25% ≤ average utilization s 60%, take no action. • If the average utilization > 60%, then an action is instantiated to double the number of instances if the doubled value does not exceed 2 * 10%. If the number of instances exceeds this limit upon doubling, take no action. Given an array of integers that represent the average utilization at each second, determine the number of instances at the end of the time frame. Example instances=2 C Learning Path Info D X ☆ * 0 1 ☀ Ⓒ I Line: 14 Col: 1 Run Tests Submit Run as Custom Input | Download 11@ Java 8 Autocomplete Ready Ⓒ 24 25 V 26 public static int finalInstances (int instances, List<Integer> averageUtil) { for (int i=0; i<averageUtil.size(); i++){ 27 V 28 29 if(averageUtil.get(i) < 25) { 30 V 31 32 if(instances!= 1 && (instances & 1) == 0) 33 V 34 35 instances = instances / 2; Test Results Custom Input Run Code Compiled successfully. All available test cases passed Test case 10 Input (stdin) Test case 118 1 1 2 3 Test case 12 8 3 5 4 10 Test case 13 5 88 Test case 14 8 Your Output (stdout)