Majority Vote
You are given an array of integer nums[] where each number represents a vote to a candidate. Return the candidates that have […]
You are given an array of integer nums[] where each number represents a vote to a candidate. Return the candidates that have […]
Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The
Given an array arr integers. Assume sz to be the initial size of the array. Do the following operations exactly sz/2 times. In every kth (1<= k <=
Given an array of integers arr of even length n and an integer k. We want to divide the array into exactly n / 2 pairs such
Given elements as nodes of the two singly linked lists. The task is to multiply these two linked lists, say
Design a stack that supports increment operations on its elements. Implement the CustomStack class: CustomStack(int maxSize) Initializes the object with maxSize which is the maximum
Design a data structure to store the strings’ count with the ability to return the strings with minimum and maximum
You are given an array arr[] of positive integers and a threshold value k. For each element in the array, divide it into
Design your implementation of the circular double-ended queue (deque). Implement the MyCircularDeque class: MyCircularDeque(int k) Initializes the deque with a maximum size of k.
There is an array arr of heights of stone and Geek is standing at the first stone and can jump to one
You are implementing a program to use as your calendar. We can add a new event if adding the event
Given an array arr[] and an integer k. Find the maximum for each and every contiguous subarray of size k. Examples: Input: k = 3,