Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hackerland radio transmitters problem:C# solution #163

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

rasik210
Copy link
Contributor

Added a new solution for hackerland radio transmitters problem using C# programming language.

Added a new solution for hackerland radio transmitters problem using C# programming language.
@rasik210
Copy link
Contributor Author

rasik210 commented May 26, 2018

Hi @RyanFehr

I've modified the max score and difficulty level for this problem in readme as per the current status on the HackerRank website. Also, I need to discuss the space complexity of this problem. It can't be O(1). We first need to sort the input using quick sort which is an offline algorithm. So we must store the input array of n elements in memory to process it.

Once the array is sorted we anyways need the array to process the installation of radio transmitters. @dgonz001 is also doing the same in his JS solution as below:

var houses = readLine().split(' ').map(Number).sort(function(a, b) { return a - b; });

I think space complexity for this problem should be O(n). Please let me know your thoughts on the same.

@RyanFehr
Copy link
Owner

This looks correct, I must have overlooked it in the JS solution

Copy link
Owner

@RyanFehr RyanFehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Solution passes all test cases
  • Time and space complexity are correct
  • Header is formatted properly
  • Problem has been added to README and formatted properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants