We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
" Now if we permute the array as [1,4,5,3,2] , the result is a zig zag sequence. "
This will NOT be the resutl given the input in the example. So it was a very confusing exmaple to give. If you first sort the array clearly this isn't a good output.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Zig Zag Sequence
You are viewing a single comment's thread. Return to all comments →
" Now if we permute the array as [1,4,5,3,2] , the result is a zig zag sequence. " This will NOT be the resutl given the input in the example. So it was a very confusing exmaple to give. If you first sort the array clearly this isn't a good output.