In this article, you will discover the distinction between layered and monolithic operating systems. But before we get into that, it's important to understand the benefits and drawbacks of monolithic and layered operating systems. What is a Monolithic Operating System? A Monolithic Operating System is a straightforward operating system where the kernel directly manages file management, device management, process management, and memory management. It is also known as a monolithic kernel. This type of operating system is considered outdated and was used in banks for tasks like batch processing and time-sharing. The monolithic kernel controls all physical components through ... Read More
The find command in Linux is used to look for files and directories inside a directory structure. The find command's min depth and max depth arguments let you restrict the search to a certain directory or depth level. Max depth defines the maximum depth level up to which the search should be conducted, whereas min depth specifies the least depth level from the starting directory where the search should begin. These choices can help you focus your search to a certain directory or depth level within a complicated directory structure. What are min depth and max depth levels? max depth ... Read More
A palindromic string is a string that is equal to its reverse string. We are given a string that contains ‘0’, ‘1’, and ‘2’ and an array Q of length N and each index of the given array indicates a range in the form of pairs. We have to find the minimum number of characters that are needed to replace in the given range such that none of the palindromic substrings remains in that range. Sample Example Input1: string s: “01001020002”, int Q = {{0, 4}, {2, 5}, {5, 10}}; Output: 1 1 3 Explanation For the range ... Read More
Two binary strings str1 and str2 of the same length are given and we have to maximize a given function value by choosing the substrings from the given strings of equal length. The given function is such that − fun(str1, str2) = (len(substring))/(2^xor(sub1, sub2)). Here, len(substring) is the length of the first substring while xor(sub1, sub2) is the xor of the given substrings as they are binary strings so it is possible. Sample Examples Input1: string str1 = 10110 & string str2 = 11101 Output: 3 Explanation We can choose a lot of different sets of strings ... Read More
A string str is given and we can swap only adjacent characters to make the string reverse. We have to find the number of minimum moves required to make the string reverse just by swapping the adjacent characters. We will implement two approaches to find the required solution with the explanation and the implementation of the code. Sample Examples Input1: string str1 = “shkej” Output: 10 Explanation First, we will take the last character to the first position which will take 4 swappings, and then the string will be “jshke”. Then we will move ‘e’ to the second ... Read More
Prefixes are the substring from the given string that starts from the zeroth index and can go up to length 1 to the size of the string. Similarly, the suffix is the substring of any length 1 to the size of the string and ends at the last index. We will be given two strings and have to create the first string by using any number of prefixes and suffixes of the second string in any way. If it is not possible to create the given string from the given methods then we will return -1. Sample Examples Input 1: ... Read More
Encryption is the technique to change the data by using some techniques or certain steps so it changes to another information or the previous information cannot be gathered from it directly. For encryption, we have to follow certain steps that are fixed for a particular type of encryption. In this problem, we will be given a string and we have to encrypt it by following the given steps − First, we have to get all the substring that contains the same characters and replace that substring with a single character followed by the length of the substring. Now, change ... Read More
Three integers are given to us ‘a’, ‘b’, and ‘c’ represents the frequency of the three different characters ‘A’, ‘B’, and ‘C’. We have to find the number of different strings that can be formed by using these characters and there must be at least two different characters present in the string formed. We will see two approaches for this problem one is the naive approach and another is the mathematical approach. Sample Examples Input 1: a = 3, b = 2, c = 4 Output: 3 Explanation We can create three strings ‘ABC’, ‘ABC’, ... Read More
A Binary Array is a special type of array that only contains the numbers 0 and 1. In this problem, we have given a binary array and integer K. Our task is to count the maximum number of 0’s that can be flipped to 1 in a given binary array such that there are at least K 0’s between two 1s. Sample Examples Input 1: arr[] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }, K = 2 Output 1: yes Explanation The 3rd and 6th indexes of the above ... Read More
Balanced Brackets mean if we have a string of brackets then each open bracket has a corresponding close bracket and the pair of brackets is properly nested. The size of the string should be ab even number. In this problem we have given a string of the brackets that also contain the character ‘?’ and our task is to form every possible balanced bracket string by replacing the ‘?’ to appropriate brackets. In our given string only parentheses ‘(‘ and ‘)’ brackets are used. Sample Examples Input 1: str = “()(?)?” Output 1: ()(()) Explanation Only one balanced ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP