[Salesforce] OA 2025 start – 1 Apr (design ready)

Minimum Substitutions to Remove Adjacent Duplicates

For each word in a list of words, if any two adjacent characters are equal, change one of them. Determine the minimum number of substitutions so the final string contains no adjacent equal characters.


Minimum Removals to Make Array Almost Sorted

An array of integers is almost sorted if at most one element can be deleted from it to make it perfectly sorted in ascending order.

For example, the following arrays are almost sorted because they have 0 or 1 elements out of place:

[2, 1, 7]
[13]
[9, 2]
[1, 5, 6]

The following arrays are not almost sorted because they have more than one element out of place:

[4, 2, 1]
[1, 2, 6, 4, 3]

Given an array of n unique integers, determine the minimum number of elements to remove so it becomes almost sorted.

我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *