Блог пользователя Nilimsankar

Автор Nilimsankar, история, 4 месяца назад, По-английски

Given two arrays, current and desired, each representing the order of n elements, find the minimum number of operations required to transform current into desired.

Operation: - In one operation, you can select an element from the end of the current array and insert it at any position within the array.

Output: - Return the minimum number of such operations needed to make current equal to desired.

TC-1 current — 2 1 3 5 4 desired — 2 4 1 5 3 output = 2

TC-2 current — 2 1 3 desired — 1 2 3 output= 2

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится