Answer:
The solution code is written in Python
- def printDottedLine():
- print(".....")
Explanation:
A function printDottedLine() is defined (Line 1). The bracket is left empty since this function is not required to take any parameters. Besides, there is no return statement inside the function as it is not expected to return anything.
Inside the function, print function is used to output a single line consisting of 5 periods as required by the question (Line 2).
A feature that preserves open apps and data while allowing another user to log in to his or her own session of the same computer is: switch user.
<h3>What is a computer?</h3>
A computer is an electronic device that is designed and developed to receive data from an end user in its raw form (input) and processes these data into an output that could be used for other purposes.
Generally, all computers are designed and developed with a feature called switch user, so as to preserve open software applications and data while allowing another user to log in to his or her own session of the same computer simultaneously.
Read more on computer here: brainly.com/question/959479
movieID = 132 Int
movieCost = 4.95 Float
movie ='Star Wars' string
movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild') tuple
movieStars = ['Carrie Fisher', 'Harrison Ford'] list
movieRatings = {5:'language', 3:'violence'} dictionary
If you want these explained , can do in replies :)
Answer:
You can simplify the problem down by recognizing that you just need to keep track of the integers you've seen in array that your given. You also need to account for edge cases for when the array is empty or the value you get would be greater than your max allowed value. Finally, you need to ensure O(n) complexity, you can't keep looping for every value you come across. This is where the boolean array comes in handy. See below -
public static int solution(int[] A)
{
int min = 1;
int max = 100000;
boolean[] vals = new boolean[max+1];
if(A.length == 0)
return min;
//mark the vals array with the integers we have seen in the A[]
for(int i = 0; i < A.length; i++)
{
if(A[i] < max + 1)
vals[A[i]] = true;
}
//start at our min val and loop until we come across a value we have not seen in A[]
for (int i = 1; i < max; i++)
{
if(vals[i] && min == i)
min++;
else if(!vals[i])
break;
}
if(min > max)
return max;
return min;
}