Microsoft OA | NIT Rourkela | SWE Internship | 27th July 2023 | Maximum number of strings | Infinite sequence of stacks
Microsoft · Question · Posted Jul 2023
Question 1 What is the maximum number of strings from S that can be built? Write a function: int solution (vector<string> &S, int K); that, given an array S and an integer K, returns the maximum number of strings from S that can be built. Examples: 1. Given S = ["abc", "abb", "cb", "a", "bbb"] and K = 2, the function should return 3. Strings "abb", "a" and "bbb" can be built using the two letters 'a' and 'b'. 2. ...
The full answer & interview discussion are available to premium members.
Log in Create a free account