Company: Komprise
Difficulty: medium
A remainder problem Problem Description Assume that you are working on a project that involves processing large numbers represented as strings. You are given a large number N in the form of a string, an integer K, and Q queries. For each query, you need to determine if there exist subsequences of N that satisfy a specific condition. The condition is that when the digits of N are concatenated without changing the relative ordering, and the resulting number is divided by K, it leaves a remainder of X. Function description Complete the `solve_queries` function. This function takes the following 4 parameters and returns the list of strings: N : Represents the given integer value in the form of a string K : Represents the number to which a subsequence of N must be divided Q : Represents the size of the query array queries : Represents the elements X in the array Examples Example 1: Input: 174 9 3 0 1 2 Output: NO YES YES Explanation: Given: N = "174" K = 9 Q = 3 queries = [0, 1, 2] Approach