Given an array of positive integers you can reshuffle the array and construct a new array on which we can perform operation X on it the elements we receive must be in Read more →
Queue
5 postsGiven an array Arr[N] of integers, where N is the size of the array. Our task is to rearrange the array such that arr[i]%2 = i%2, in other words, the element at Read more →
LRU cache implementation: Here we have two methods get and set which are defined as follows: get(x) : If the key x exists in the cache, returns its value and update reference Read more →
You are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced if there is Read more →
Queue is an ordered list in which all insertions at one end called REAR and deletions are made at another end called FRONT. Queues are sometimes referred to as First In First Read more →