DoorDash | OA |Calculate Difference Value | 18dec 2022 | Coding round

Question · Posted Apr 2026

Problem: Calculate Difference Value Objective You are given two strings, firstString (length n) and secondString (length m). You want to remove characters from secondString so that what remains is a subsequence of $firstString$. The Cost (Difference Value) The cost of removing characters is defined by the range of their original indices: {Difference Value} = |max index removed} - {min index removed} | + 1 Essentially, if you remove any set of characters, you pay for the entire contiguous span from ...

The full answer & interview discussion are available to premium members.

Log in Create a free account