Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#!/bin/python3 import math import os import random import re import sys # # Complete the 'maxStreak' function below. # # The function is expected to

image text in transcribed

#!/bin/python3

import math

import os

import random

import re

import sys

# # Complete the 'maxStreak' function below. # # The function is expected to return an INTEGER. # The function accepts following parameters: # 1. INTEGER m # 2. STRING_ARRAY data #

def maxStreak(m, data): # Write your code here

A project manager wants to look at employee attendance data. Given that m employees are working on the project, and the manager has the record of the employees present on n days of the project, help him find the maximum number of consecutive days on which all employees were present and working on the project As an example, there are m 3 employees and n-5 workdays to analyze. The a data = [YYY YYY YNN, YYN, YYNL There are only two days, at the beginning of the period, where ali workers are present. Using zero indexing for employees, 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 e data strings 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 maxStreak has the following parameters: m: an integer denoting the number of employees working on the project. data: an array of n strings, where the value of each element datali] is a string where datalijlj] denotes if the jth employee is present on the ith day. Constraints 1sm s 10 . 1sns 100000 . Each data[i][j]e(',,N)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago