Question 1
Given a_ap(first term of ap), d(common diffrence), a_gp(first term of gp), r(common ratio), and n, generate a sequence of length 2n where even indices hold the first n terms of an AP and odd indices hold the first n terms of a GP.
Question 2
Given a 26×26 cost matrix and a string s, compute the total cost of converting each s[i] to s[i+1] sequentially.The string is composed of only upper case characters.
Question 3
Given an array, choose 1 ≤ l < r ≤ n and replace elements in (l, r) with min(a[l], a[r]) any number of time to maximize the total array sum.
Question 4
Given an array a[] and a number k, count pairs (i, j) where:
- a[i] * a[j] == k
- a[i]^2 + a[j]^2 is even
- a[i] XOR a[j] is even