Overview A string is given. The objective is to reverse all vowels in that string Example 1 Example 2 Program Below is the program for the same Output: Also, check out our…
Author: admin
Determine Whether Matrix Can Be Obtained By Rotation
Overview Two n*n matrices are given source and target. We have to determine whether the source matrix can be converted to the target matrix by doing 90-degree rotations any number of times…
Detonate the maximum bombs program
Overview A 2d array is given where each entry in an array has three values i- Denotes the x coordinates of the bomb j – Denotes the y coordinates of the bomb…
Rotting Oranges Program
Overview An m*n matrix is given where each entry contains three values 0 – Denotes that entry is empty 1 – Denotes that entry contains fresh orange 2 – Denotes that the…
Count unreachable pair of nodes in an undirected graph
Overview An integer n is given. There are n nodes numbered 0 to n-1. A 2D integer array edges is also given where edges[i] = [ai, bi] means that there is an…
Find the number which appears once in an array
Overview An array is given in which every element is present twice except one element. The objective is to find that element in constant extra space Example 1 Example 2 The idea…
Majority element in an array
Overview The objective is to find the majority element in a given array. A majority element is an element that occurs more than n/2 times in a given array where n is…
Unique ID Generation System Design
Overview Distributed Systems are a norm these days. Sometimes there is a requirement to generate Unique IDs across such distributed systems. Some of these unique ID requirements could be There is Order…
Program for Binary Search in a sorted array
Overview Idea is to do a binary search of a given target element in an input array. If the target element is present then output the index. If the output element is…
Pastebin System Design
Overview First, let’s look at the definition of Pastebin. Pastebin service allows you to share text and images over a link which can be shared with multiple users. So basically Pastebin is…