Infosys, Recently Asked Online Assessments in 14 Dec, 2025 | BinStr Subsequence | Matrix Chain Multiplication Variant
Infosys · Question · Posted Apr 2026
Question 1: Easy : BinStr Problem Statement: You are given a binary string S (containing only '0's and '1's) of length N and a positive integer K. Define a function binary_value(sub) that takes a binary string sub and returns its decimal value (treating sub as a binary number). Find the maximum length of a subsequence sub of S such that binary_value(sub) \le K and sub is a subsequence of S (obtained by deleting some characters without changing the order). Notes: ...
The full answer & interview discussion are available to premium members.
Log in Create a free account