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;
}
Lookup the isalpha() function in the C standard library, this function will check and return non-zero for alphabetic characters.
On A Windows machine, you can use the netsh command.
<span>netsh interface ip set dns name="Local Area Connection" static 208.67.222.222
All the steps below means you have access to the router via Telnet or physical access and it already has a valid configuration (except the DNS)
On a Cisco Router is:
</span><span>Step 1: <span>enable
</span></span><span>Step 2: <span>configure <span>terminal
</span></span></span><span>Step 3: <span>Do one of the following: <span><span>ip domain name name
</span><span><span>ip domain list </span><span>name
</span></span></span></span></span><span>Step 4 : Device(config)# ip name-server 172.16.1.111 172.16.1.2</span>
Answer:
B is the only answer that makes sence
For every 1 gigabyte equals 1000 megabytes. Therefor Amy can store 8000 pictures on her smartphone.
1 GB to 1000 MB
16 GB to 16000 MB
File size 2 MB
16000 MB divided by 2 MB = 8000 MB