## Power of Four Leetcode Solution

Problem Statement We are given an integer and we have to check if the number is power of 4 or not. A number is power of 4 if there exist an integer a such that,  num= 4^a. Example 16 true 5 false Approach 1 (Brute Force) An obvious way to …

## Insert Delete GetRandom

In Insert Delete GetRandom problem we need to design a data structure that supports all following operations in average O(1) time. insert(val): Inserts an item val to the set if not already present. remove(val): Removes an item val from the set if present. getRandom: Returns a random element from the current set …

## Shuffle a given Array

Problem Statement In the “Shuffle a given Array” problem we have given an array of integers. Write a program that shuffles the given array. That is, it will shuffle the elements in the array randomly. Input Format The first line containing an integer n. Second-line containing n space-separated integer Output …

## Maximum Circular Subarray Sum

Problem Statement In the maximum circular subarray sum problem, we have given an array of integers arranged in a circle, find the maximum sum of consecutive numbers in the circular array. Example Input arr[] =  {13, -17, 11, 9, -4, 12, -1} Output 40 Explanation Here, sum = 11 + …