Company: Stanley shl on campus_13april

Difficulty: medium

Problem Statement

The current selected programming language is C++14 . We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted , you cannot review this problem again. You can use cout to debug your code. The cout may not work in case of syntax/runtime error. The version of GCC being used is C++14 (GCC 5.4) . A logistics company keeps a log of its warehouse stock transfers across N days. This log is represented as a binary string of 0s and 1s, where 0 marks a day with no transfer scheduled and 1 marks a day that already has one scheduled. Because demand in the market has risen, the company wants to add D more transfer days somewhere within the N-day log. This means converting D of the currently unscheduled days (0s) into scheduled ones (1s) within the binary string. The company wants to know in how many distinct ways it can do this so that the longest run of consecutive scheduled days is as large as possible. Two ways that end up producing the same fi

More Stanley shl on campus_13april OA questionsInterview experiences