Remove brackets from an algebraic string containing + and – operators

Problem Statement You are given a string s of size n representing an arithmetic expression with parenthesis. The problem “Remove brackets from an algebraic string containing + and – operators” asks us to create a function that can simplify the given expression. Example s = “a-(b+c)” a-b-c  s = a-(b-c-(d+e))-f a-b+c+d+e-f …

Read more

Shuffle 2n integers as a1-b1-a2-b2-a3-b3-..bn without using extra space

Problem Statement You are given an array of integers. The problem “Shuffle 2n integers as a1-b1-a2-b2-a3-b3-..bn without using extra space” asks to shuffle all the numbers in the array such that the numbers which are like (x0, x1, x2, x3, y0, y1, y2, y3) will be shuffled like x0, y0, …

Read more

Maximum length subsequence with difference between adjacent elements as either 0 or 1

Problem Statement You are given an integer array. The problem “Maximum length subsequence with difference between adjacent elements as either 0 or 1” asks to find out the maximum subsequence length with the difference between the adjacent elements should be none other than 0 or 1. Example arr[] = {1, …

Read more

Translate »