Count Minutes to Increase Stick Length for Triangle in C++

Arnab Chakraborty
Updated on 03-Mar-2022 11:07:55

272 Views

Suppose we have three numbers a, b and c. There are three sticks whose lengths are a, b and c. In one minute, we can pick one arbitrary stick and increase its length by 1 cm, but we cannot break sticks. We have to count the minimum number of minutes needed to increase their lengths and we can form a triangle with them.So, if the input is like a = 2; b = 3; c = 5, then the output will be 1, because by increasing any one of a or b by 1, we can make a triangle (a ... Read More

Check if Two Strings can be Made Equal by Swapping from Third String in C++

Arnab Chakraborty
Updated on 03-Mar-2022 11:03:25

308 Views

Suppose we have three strings S, T and U of same length n. For every index i in range 0 to n-1, we must swap U[i] with either S[i] or T[i]. So in total we have performed n swapping operations. We have to check whether after such n operations we can make string S exactly same as T.So, if the input is like S = "abc"; T = "bca"; U = "bca", then the output will be True, because for all i if we swap U[i] with S[i], it will be "bca", and T is already "bca".StepsTo solve this, we ... Read More

Find Maximum Possible Median of Elements Whose Sum is S in C++

Arnab Chakraborty
Updated on 03-Mar-2022 11:00:07

361 Views

Suppose we have two numbers n and s. We have to find the maximum possible median of an array of n non-negative elements, such that the sum of elements is same as s.So, if the input is like n = 3; s = 5, then the output will be 2, because for the array [1, 2, 2], the sum is 5 and median is 2.StepsTo solve this, we will follow these steps −m := floor of (n / 2) + 1 return floor of (s / m)ExampleLet us see the following implementation to get better understanding −#include using namespace ... Read More

C++ Program to Find Permutation with N Peaks

Arnab Chakraborty
Updated on 03-Mar-2022 10:56:54

287 Views

Suppose we have two numbers n and k. We have to construct a permutation A using the numbers from 1 to n which has exactly k peaks. An index i is said to be peak of an array A, if A[i] > A[i-1] and A[i] > A[i+1]. If this is not possible, return -1.So, if the input is like n = 5; k = 2, then the output will be [2, 4, 1, 5, 3], other answers are also possible.StepsTo solve this, we will follow these steps −if k > (n - 1) / 2, then:    return -1 Define an array a of size: 101. for initialize i := 1, when i

Check Three Items Circularly in C++

Arnab Chakraborty
Updated on 03-Mar-2022 10:51:51

116 Views

Suppose we have an array A with n elements. There are n planes on Earth and they are numbered from 1 to n. The plane with number i likes plane A[i]. A[i] != i. We have to check whether there are three planes p, q, and r where p likes q, q likes r and r likes p.So, if the input is like A = [2, 4, 5, 1, 3], then the output will be True, because the triplet is [2, 4, 1].StepsTo solve this, we will follow these steps −n := size of A for initialize i := 0, ... Read More

Find Perfect Array of Size N Whose Subarray is a Good Array in C++

Arnab Chakraborty
Updated on 03-Mar-2022 10:48:51

202 Views

Suppose we have a number n. An array B is good if the sum of its elements is divisible by the length of this array. We can say an array A with n elements is perfect, if non-empty subarray of this array A is good and elements in A is in range 1 to 100. From the number n, we have to find an array A which is perfect.So, if the input is like n = 4, then the output will be [7, 37, 79, 49], other answers are also possible.StepsTo solve this, we will follow these steps −for initialize ... Read More

Types of Intrusion Detection Systems in Information Security

Ginni
Updated on 03-Mar-2022 10:45:33

1K+ Views

An intrusion detection system (IDS) is an app or device that monitors inbound and outbound network traffic, continuously analyzing events for changes in patterns, and alerts an administrator when it identify unusual behavior. An administrator can reviews alarms and takes actions to delete the threat.For example, an IDS can inspect the data carried by network traffic to look if it includes known malware or other malicious content. If it can identify this type of threat, it sends an alert to the security team so they can investigate and remediate it. Because your team receives the alert, they should act rapidly ... Read More

Count Number of Problems Solved from Left or Right End of List in C++

Arnab Chakraborty
Updated on 03-Mar-2022 10:43:31

290 Views

Suppose we have an array A with n elements and another number k is there. Consider there are n problems on a contest. Amal's problem solving skill is k. Amal always solves problem from any of the ends of a list. And He cannot solve problem whose difficulty is greater than k. He stops when the left and right problems' difficulty is greater than k. We have to count how many problems he can solve. A[i] represents the difficulty of ith problem.So, if the input is like A = [4, 2, 3, 1, 5, 1, 6, 4]; k = 4, ... Read More

What is an Intrusion Detection System in Information Security

Ginni
Updated on 03-Mar-2022 10:43:30

2K+ Views

An intrusion detection system (IDS) is software specifically develop to monitor network traffic and find irregularities. An IDS is designed to detect network traffic and match traffic designs to known attacks. Through this method, sometimes known as pattern correlation, an intrusion prevention system can determine if unusual event is a cyberattack.Because suspicious or malicious activity is found, an intrusion detection system will send an alarm to specified technicians or IT administrators. IDS alarms allows us to rapidly start troubleshooting and identify root sources of problems, or discover and stop harmful agents in their tracks.Intrusion Detection System (IDS) technology is an ... Read More

What is a Physical Access Control System

Ginni
Updated on 03-Mar-2022 10:41:49

1K+ Views

Physical access control systems are a type of physical security intended to restrict or enable access to a specific area or building. Often, PACS are installed to secure businesses and property from vandalism, theft, and trespassing, and are particularly useful in facilities that needed larger levels of security and protection.Access controls protect against imprudent access of equipment, data documents, and software. It can restrict physical access, a security system should be able to differentiate between authorized and unauthorized individuals. Physical access can be restricted using three general techniques.Identification − Identification based on comparing the physical traits of the individual with ... Read More

Advertisements