Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

Task - help

$
0
0

Can anyone help with this task.

Given a sequence of N different integers. Operations allowed members of the series are:

Move to the beginning of the sequence

Move to the end of the sequence

Print the smallest number of necessary operations to a default set of ascending sorted.

For example:

Input

4 3 4 2 1

Output

2

Thank you.


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>