Kth Largest Element in a Stream Leetcode Solution

Problem Statement In this problem, we have to design a class KthLargest() that initially has an integer k and an array of integers. We need to write a parameterized constructor for it when an integer k and array nums are passed as arguments. The class also has a function add(val) that adds …

Read more

Sum of Even Numbers After Queries

Problem Statement In this problem, we are given an array of integer and array of arrays queries. For the ith query, we will have two parameters, index and val. After each query, we add val to array[index]. We need to find the sum of all even integers in the array after …

Read more