Lily's Homework

Sort by

recency

|

54 Discussions

|

  • + 2 comments

    Why the output of test case 3 2 3 1 is 1?

  • + 0 comments

    Will the method as given in the editorial work if all the elements are not distinct ?

  • + 0 comments

    Can anyone explain what editorial's code does? I don't really understand it. Brief explanation of algorithm will do. Thanks in advance!

  • + 1 comment

    By beautiful, it basically means ascending order? I really don't get the beautiful part.

  • + 1 comment

    Can anyone please point out as to where I am going wrong ? I am finding out the number of swaps involved while sorting the array in ascending order and descending order and then printing out the minimum. Still can't understand my mistake.. Here's my submission link: https://www.hackerrank.com/contests/hourrank-14/challenges/lilys-homework/submissions/code/7634222