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.
1) The question states "the task is to debug the existing code to ..."
-> There is no existing code (apart from "Main" function header) in C#.
all other challegnes so far have at least the boilerplate code to read the input from STDIN and output result.
Seems like an overlook / missing work from the maintainer.
2) Question states "Note: You can modify at most three lines in the given code. You cannot add or remove lines of code. "
I don't see how this is possible to add 3 lines of code from virtually no code to solve this (see previous remark), except by stretching the definition of "line of code" and put every statement on the same line separated by ";" .
3) the examples in description are ambiguous :
"You need to find the lexicographically smallest zig zag sequence of the given array.".
Just below this, an example shows:
"""
Example. a= [2, 3, 5, 1, 4]
Now if we permute the array as [1, 4, 5, 3, 2], the result is a zig zag sequence.
"""
But a smaller lexicographic zigzag sequence would be [1, 2, 5, 4, 3] ... Why is this example shown if this is not the expected output ?
4) The exercise is definitely broken. I have the exact same answer as expected output but the run test sohws "Wrong answer":
Compiler Message
Wrong Answer
Input (stdin)
1
7
1 2 3 4 5 6 7
Your Output (stdout)
1 2 3 7 6 5 4
Expected Output
1 2 3 7 6 5 4
:(
:(
:(
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 →
Doing challenge in C# here.
FOUR CRITICAL issues with this question:
1) The question states "the task is to debug the existing code to ..."
-> There is no existing code (apart from "Main" function header) in C#.
all other challegnes so far have at least the boilerplate code to read the input from STDIN and output result.
Seems like an overlook / missing work from the maintainer.
2) Question states "Note: You can modify at most three lines in the given code. You cannot add or remove lines of code. "
I don't see how this is possible to add 3 lines of code from virtually no code to solve this (see previous remark), except by stretching the definition of "line of code" and put every statement on the same line separated by ";" .
3) the examples in description are ambiguous :
"You need to find the lexicographically smallest zig zag sequence of the given array.".
Just below this, an example shows: """ Example. a= [2, 3, 5, 1, 4]
Now if we permute the array as [1, 4, 5, 3, 2], the result is a zig zag sequence. """
But a smaller lexicographic zigzag sequence would be [1, 2, 5, 4, 3] ... Why is this example shown if this is not the expected output ?
4) The exercise is definitely broken. I have the exact same answer as expected output but the run test sohws "Wrong answer": Compiler Message
Wrong Answer
Input (stdin)
Your Output (stdout)
Expected Output