These few questions I witnessed seemed just not possible to solve in given constraints. Correct me if I am wrong and please discuss your solutions
Given an array A. You are required to find smallest subset of the array such that bitwise OR of the values, of elements in the subset is maximum.
Analysis: We can find the maximum OR possible which is essentially OR of all elements, and then find the smallest subset which has this OR. Now, this problem is as evident in these links (https://codeforces.com/blog/entry/74836 & https://en.m.wikipedia.org/wiki/Set_cover_problem), is an NP Hard Problem. But would that be suffice to pass N in [1, 10^5] and A[i] in [1, 10^6] in one second?
Given an array A (N elements, distinct), B (M elements, non distinct). Find minimum number of elements to be inserted at any location in B, so that A is a subsequence of B.
Analysis: The approach I could think of was to do a 2D Dynamic Programming (like this of https://leetcode.com/problems/edit-distance/). Given, both N and M in [1, 10^5] that can't pass 1 second limit. I could not think of a better solution. What is you approach in this?
Although, if A is sorted (which it is in 5 test cases they provided), there can be a Nlog(N) solution.