Count Permutations by Replacing Characters in a Binary String

Shubham Vora
Updated on 10-Aug-2023 10:24:47

187 Views

In this problem, we have given a string containing 0, 1, and ? characters. We need to find permutations of the string by replacing ‘?’ with 0 and 1. The logic to solve the problem is that we can replace every ‘?’ with either 0 or 1. So, by replacing one ‘?’, we can generate two different permutations, and by replacing N ‘?’ with 2 possibilities, we can generate 2^N permutations. In this tutorial, we will learn two different approaches to solving the given problem. Problem statement – We have given string str containing ‘0’, ‘1’ and ‘?’ characters. We ... Read More

Count New Pairs of Strings by Swapping First Characters

Shubham Vora
Updated on 10-Aug-2023 10:22:24

159 Views

In this problem, we need to select the pair of strings and swap their first character. After that, we need to count the total number of new pairs. We can solve the problem by swapping the first character of each pair and checking whether it exists in the array. The efficient approach to solve the problem can be using the hashmap data structure. Problem statement – We have given an array containing N strings. We can take any of two strings from all array elements and swap the first characters of both strings. We need to count the total ... Read More

Check If Number Formed by Array Elements is a Harshad Number

Shubham Vora
Updated on 10-Aug-2023 10:19:29

142 Views

In this problem, we have given the array of integers. We need to combine all elements in a single integer and check if it is a Harshad number. Before we move with the solution, let’s understand Harshad number. All numbers are Harshad numbers which are divisible by the sum of their digits. For example, 12 is Harshad number, as 12 is divisible by 3 = 1 + 2. To solve the problem, we can combine all array elements, and after that, we can check whether the resultant number is the Harshad number. Problem statement – We have given an array ... Read More

Check If All Characters of a String Can Be Made Equal by Increments or Decrements

Shubham Vora
Updated on 10-Aug-2023 10:17:50

226 Views

In this problem, we need to check if we can make all characters of strings equal by increment and decrement operations. We can get the weight of each character based on their ASCII values and check whether the total weight can be used to make all characters equal. Problem statement – We have given string str of length N containing lowercase alphabetical characters. We need to check whether we can make all characters of the string equal by choosing any of two characters, increasing one, and decreasing another by 1. If possible, print ‘yes’, else ‘no’. Sample examples Input– ... Read More

Difference Between Injection Molding and Extrusion

Md. Sajid
Updated on 09-Aug-2023 19:42:58

741 Views

Injection molding and extrusion are two typical manufacturing procedures used to generate a wide range of products from various materials, such as plastics, metals, and even food. While both processes are classified as "forming, " they differ in their applications, methodologies, and final products. Read this article to find out more about Injection Molding and Extrusion and how they are different from each other. What is Injection Molding? Molding, sometimes called as "molding" in some areas, is a manufacturing technique that uses a mold or a die to shape raw materials into desired shapes. Heating the raw material to a ... Read More

Difference Between iGoogle and Google Chrome

Md. Sajid
Updated on 09-Aug-2023 19:40:33

1K+ Views

Google's iGoogle and Google Chrome were popular products, but they served different objectives and had different functionalities. Read this article to find out more about iGoogle and Google Chrome and how they are different from each other. What is iGoogle? Google Personalized Homepage, or iGoogle, was a web portal service released by Google in May 2005. It aspired to provide customers with a configurable homepage that collected information from numerous sources, allowing it to serve as a one-stop destination for personalized content and services. The service allowed users to create a personalized dashboard out of a collection of widgets ... Read More

Difference Between iChat and Skype

Md. Sajid
Updated on 09-Aug-2023 19:39:26

168 Views

iChat and Skype were popular communication tools, yet they provided unique features and functionality. Apple Inc. created iChat, a messaging application. It was designed mainly for Mac users and was included in macOS until macOS 10.7 Lion. Skype is a popular communication platform that offers a variety of services, such as instant messaging, voice calls, video calls, and file sharing over the internet. Read this article to find out more about iChat and Skype and how they are different from each other. What is iChat? Apple Inc. created iChat, a messaging application for Mac users. It was first included ... Read More

Difference Between Google Talk and Gchat

Md. Sajid
Updated on 09-Aug-2023 19:37:46

491 Views

Google Talk and GChat were both communication services provided by Google, although they differed significantly in terms of operation and features. Read this article to find out more about Google Talk and Gchat and how they are different from each other. What is Google Talk? Google Talk, commonly known as GChat or Google Chat, was a Google instant messaging service. It debuted in 2005 as a simple and effective means for users to interact in real time through text messaging, audio calls, and file sharing. Google Talk was accessible as a standalone desktop application as well as being ... Read More

Difference Between Google and Google Chrome

Md. Sajid
Updated on 09-Aug-2023 19:36:13

22K+ Views

Google and Google Chrome are two different products offered by Google Inc., the technology giant. They perform numerous functions and address various parts of the digital environment. Read this article to find out more about Google and Google Chrome and how they are different from each other. What is Google? Google is a multinational technology business started by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University on September 4, 1998. The objective of the company is "to organize the world's information and make it universally accessible and useful." Google has risen over the years ... Read More

Difference Between Games and Simulations

Md. Sajid
Updated on 09-Aug-2023 19:35:10

745 Views

Simulations and games are two unique types of interactive experiences that have grown in popularity in the realms of entertainment, education, training, and research. While they have certain similarities in their interactive character, ambitions, and use of technology, they serve various purposes and provide their users with diverse experiences. Read this article to find out more about Games and Simulations and how they are different from each other. What are Games? Games are interactive experiences in which players participate in organised activities with defined goals, rules, and difficulties. They are designed to provide pleasure and enjoyment, and they frequently involve ... Read More

Advertisements