Articles on Trending Technologies

Technical articles with clear explanations and examples

Check score of given binary string

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 20-Apr-2023 384 Views

The sequence of bytes is called a binary string and it holds the binary value. A binary score is normally presented on a range from 0 to 1 where 1 is reserved for the perfect model. In the given binary string, If the element is found to be 1 then it will calculate as the score and increment the count sum. Let’s take an example of a binary score − The given binary string is 1011010. In the above figure, the number 1 is present in the index- 0, 2, 3, and 5. Therefore, the total score is 4 ...

Read More

Length of longest substring that do not contain any palindrome

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 20-Apr-2023 423 Views

In C++, we have predefined function max() that will be used for finding any longest substring that does contain any palindrome. A palindrome string is a group of characters that remains the same even after reversing. Let’s take an example of a palindrome string to make the longest non-palindrome substring. The string malayalam itself is a palindrome but we need to identify the longest non-palindrome substring. When we change the string malayalam( length=9 ) to alayalam then we get the longest non-palindrome substring length i.e, 8. The string synapse is a non-palindrome string and its length is 7. ...

Read More

Check if string can be made lexicographically smaller by reversing any substring

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 20-Apr-2023 796 Views

In C++ we have an inbuild reverse() function that will be used for reversing the substring to check whether a string can be made lexicographically smaller or not. Lexicographic ordering is the process by which the character of a word is sorted in a dictionary. Let’s take an example of a string to check lexicographically smaller or not. We will compare the two words to check the lexicographically smaller ones and take two strings namely ‘apple’ and ‘army’. Both these strings of the first letter starting with letter ‘a’. When we move to check the second character of both ...

Read More

Replace every consonant sequence with its length in the given string

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 20-Apr-2023 506 Views

This article will help us understand how to replace the consecutive consonant sequence with its length in the given string. Consonants are series of alphabetical letters that are not vowels. Here we need to first identify which letter in the string are consonants. For example, in the word “abcdiopqrsu”, the consonant sequence “bcd” and “pqrs”. Next, we would replace each consonant sequence with its length. So the word “bcd” would replace with “3” because there are three consecutive consonants, and the same with the word “pqrs” replace with “4” as there are four consecutive consonants. Algorithm First, we ...

Read More

Haskell Program to convert double type variables to int

Akhil Sharma
Akhil Sharma
Updated on 20-Apr-2023 1K+ Views

In Haskell, we will convert double type variables into int by using user-defined function, doubleToInt along with floor, round and ceiling functions. In the first example, we are going to use (doubleToInt d = floor d) function and in the second example, we are going to use (doubleToInt d = round d). And in the third example, we are going to use (doubleToInt d = ceiling d). Algorithm Step 1 − The doubleToInt function is defined using floor function as, doubleToInt d = floor d. Step 2 − The program execution will be started from main function. The ...

Read More

Haskell Program to convert int type variables to String

Akhil Sharma
Akhil Sharma
Updated on 20-Apr-2023 4K+ Views

In Haskell, we will convert int type variables into string by using user-defined function, intToString along with show, map and printf functions. In the first example, we are going to use (intToString n = show n) function and in the second example, we are going to use (intToString n = intercalate "" (map show [n])). And in the third example, we are going to use (intToString n = printf "%d" n). Algorithm Step 1 − The intToString function is defined using show function as, intToString n = show n. Step 2 − The program execution will be started ...

Read More

Haskell Program to convert string type variables into int

Akhil Sharma
Akhil Sharma
Updated on 20-Apr-2023 1K+ Views

In Haskell, we will convert string type variables into integer by using user-defined function, stringToInt along with read and readMaybe functions. This can also be implemented using pattern matching and recursion. In the first example, we are going to use (stringToInt str = readMaybe str) function and in the second example, we are going to use (stringToInt "" = Nothing; stringToInt ('-':xs) = negate ; stringToInt xs; stringToInt xs = case reads xs of [(n, "")] -> Just n and _ -> Nothing). Algorithm Step 1 − The stringToInt function is defined using readMaybe function Step 2 ...

Read More

Haskell Program to convert string type variables into boolean

Akhil Sharma
Akhil Sharma
Updated on 20-Apr-2023 692 Views

In Haskell, we will convert string type variables into boolean by using user-defined function, stringToBool along with Maybe Bool, toLower and readMaybe functions. In the first example, we are going to use (stringToBool :: String -> Maybe Bool) function and in the second example, we are going to use (stringToBool str = case map toLower str of). And in third example, we are going to use (stringToBool str = case readMaybe str of). Algorithm Step 1 − The stringToBool function is defined. Step 2 − The program execution will be started from main function. The main() function has whole ...

Read More

The Benefits Of Technical SEO For Small Businesses

Arpa Chatterjee
Arpa Chatterjee
Updated on 20-Apr-2023 341 Views

Companies must differentiate themselves and become more visible on Google, where more than 3.5 billion daily queries are performed (by truelist.co). SEO is the most efficient method for achieving this goal. SEO efforts can result in improved visibility in SERPs (search engine results pages), more engaged visitors, and more sales. Using technical SEO, you may increase the likelihood that visitors will like their time on your site and come back in the future. While it's true that SEO relies heavily on keywords and relevant content, modern consumers also demand a pleasant browsing experience. After all, bad website experiences result in ...

Read More

How To Use Technical SEO To Boost Your Local Business

Arpa Chatterjee
Arpa Chatterjee
Updated on 20-Apr-2023 285 Views

To succeed as a local company in the modern day, you must go where the customers already are: online. Your present clientele can only sustain a brick-and-mortar business for so long. Having a web presence where potential clients may learn about your company is crucial. You'll need a website and local listings in particular. And you'll need to take special steps to have these items indexed by search engines. Search engine optimization (SEO) describes this process. This scary-sounding concept is about gaining readers' trust with consistently excellent content. In this piece, we'll go over some SEO best practices that can ...

Read More
Showing 37831–37840 of 61,297 articles
Advertisements