Dear readers, today read in this article how to smooth the image in C ++ program? If you have a 2D matrix M that represents the gray scale of an image, then we need to design a smoothie to create a gray scale of every 8 gray pixels that surrounds all 8 pixels and the ..
Category : C & C ++ Interview Q&A
Dear readers, today we read this tutorial on minimum genetic mutation in C ++. If you have a gene string. It can be represented by a string whose length is 8, this string is made up of these letters [A, C, G, T]. Now consider that we want to investigate about a mutation, where the ..
Dear readers, today we read this tutorial on Total Hamming Distance in C ++? If you have a list of numbers. We have to find the Hamming distance of all pairs of given numbers. We know that the Hamming distance between two integers is the number of terms on which the corresponding bits differ. Example ..
Today we will read on this article – Continuous Saber Sum in C ++. If we have a list of non-negative numbers and the target integer k, then we need to write a function to check whether the array has at least a constant size of 2 s and it goes up to several k, ..
Today we will read on this article – Random flip matrix in C ++: If we have n_rows the number of rows and the number of columns of n_cols. All values here are initially 0. We have to define a function flip () that randomly selects the 0 value equally, changes it to 1, and ..
Today we will read on this article – Dictionary through Dictionary in C ++: If we want to find the longest string in the dictionary, it can be created by removing some letters of the given string. If there is more than one possible outcome, simply return the shortest term with lexicographic order. If there ..
Today we will read on this article – Contiguous Array in C ++: If we have a binary array, then we need to find the maximum length of a contiguous subs with the same number of 0’s and 1’s. If the input is like [0,1, 0], then the output will be as 2 [0,1] or ..
Today we will read on this article – Beautiful arrangement in C ++: If we have integer n from 1 to n. We will define a beautiful arrangement as an array that is fully constructed by these n numbers if one of the following is true for ith the position in this array (1 <= ..
Today we will read on this article – Random pick with weight in C ++: If we have an array of positive integers, w [i] describes the weight of the index, we have to define a function pickIndex (), Which randomly chooses an index in proportion to its weight. Example #include <bits/stdc++.h> using namespace std; ..
Polybius square cipher It is a table that is used to convert letters into numbers. The table for English encryption is a 5X5 table, with 25 cells for 26 letters of an English dictionary. The letters i and j are placed together in a cell. The following table shows a polybius square cipher – 1 ..