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.
- Zig Zag Sequence
- Discussions
Zig Zag Sequence
Zig Zag Sequence
Sort by
recency
|
114 Discussions
|
Please Login in order to post a comment
There isn't a
findZigZagSequence
function in Go.Tip: if you're getting the right output but it's still failing, try a different language. Python 3 didn't work, but C++11 was fine. The code looks very similar, and the changes are the same, so even if you don't know C++ you'll likely be able to figure it out.
How is this possible? What I'm doing wrong?
This code works for C++11 :) :
Why it's not working Arrays.sort(a); int mid = (n+1)/2; List newa = new ArrayList<>(); // newa.add(a[0]); for(int i=0;i=mid-1;i--) { newa.add(a[i]); }