I need a solution for this question please , ,t's really urgent. C# , Java or Python required

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

I need a solution for this question please , ,t's really urgent. C# , Java or Python required

Post by answerhappygod »

I Need A Solution For This Question Please T S Really Urgent C Java Or Python Required 1
I Need A Solution For This Question Please T S Really Urgent C Java Or Python Required 1 (133.89 KiB) Viewed 61 times
I need a solution for this question please , ,t's really urgent.
C# , Java or Python required
6. Maximum Streak A project manager wants to look at employee attendance data. Given that memployees are working on the project and the manager has the record of the employees present on days of the project find the maximum number of consecutive days on which all employees were present and working on the project. Example m = 3 n = 5 data = [YYYYYYYNN. YYN. YYN There are 3 employees and 5 days attendance data. There are only two days at the beginning of the period. where all workers are present. Using zero based indexing for employee strings, employees 1 and 2 are absent on the third day, and employee 2 is also out on the fourth and fifth days. The maximum streak occurs at the beginning and is 2 days long Function Description Complete the maxStreak function in the editor below. The function must return an integer denoting the maximum number of consecutive days where all the employees of the project are present. Info C# Autocomplete Ready 1 > using System.CodeDon. Compiler; 16 class Result 17 18 19 /* 20 Complete the 'maxStreak' function below. 21 * 22 + The function is expected to return an INTEGER. 23 The function accepts following parameters: 24 1. INTEGERI 25 + 2. STRING_ARRAY data 26 27 28 public static int maxStreak (int n, List<string> data) 29 30 31 32 33 } 34 v class Solution 35 { 36 public static void Main(string[args) 37 { 38 TextWriter textwriter = new Streanwriter (esystem. Environment.GetEnvironnentVariable("OUTPUT_PATH"), true); 39 40 int m = Convert.ToInt32(Console.ReadLine().Trim()); 41 42 int datacount = Convert.ToInt32 (Console.ReadLine().Trim()); 43 44 List<string> data = new List<strine(); 45 for (int i = 0; i < dataCount; ++) 47 48 string dataItem - Console.ReadLine(); 49 data.Add(dataIten): 50 ) 1 51 52 Int result = Result.naxStreakin, data); 53 54 textWriter.WriteLine(result); 55 56 textWriter.Flush(); 57 textWriter.Close(); 58 ) 59 1 60 maxStreak has the following parameters: int m the number of employees working on the project. string datand the value of each element datali) is a string where datau denotes if the /"employee is present on the day, Constraints • 15m3 10 . 15 100000 . Each dara Y. N3 Input Format For Custom Testing Sample Case o 0 Sample Input o STDIN Function + 2 2 YN NH data[] Size - 2 data = [ "Y", "NN" 1 Sample Output Explanation o There are no days in data which indicate that all the employees are present Sample Case 1 Sample Case 2
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply