Hack Forums
[HFCC] The Hack Forums Coding Contest - Week 1 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [HFCC] The Hack Forums Coding Contest - Week 1 (/showthread.php?tid=5564022)



[HFCC] The Hack Forums Coding Contest - Week 1 - Haxalot - Mar 1, 2017




About
  • The HFCC is a weekly coding contest hosted by myself for the Hack Forums community. You will have 3 days to solve 5 programming challenges I have randomly selected from Hackerrank. The contest will start at 4pm (GMT) every Friday, and end at 4pm (GMT) every Monday.

    A new thread will be created roughly 2 days before each contest starts (so around every Wednesday). You should not use this thread to post solutions or provide hints until the contest is over. Anyone violating this rule will be barred from the current and all future contests I host.

What's the Point?
  • Coding challenges are a great way to improve upon your programming abilities. They encourage you to:
    • research data structures and algorithms
    • think critically and analytically about problems by breaking them down into smaller (and therefore simpler) sub problems
    • Be performance-conscious of the code you write

    This will help you to:
    • be able to apply a variety of data structures and algorithms to any problems you encounter when programming
    • improve your problem solving abilities, enabling you to tackle increasingly complex problems
    • learn new techniques (such as memoisation) and utilise more performant algorithms

    Another great advantage is that companies frequently test their candidates in interviews with similar challenges to what you will be solving in these contests. By practicing these problems, you are effectively preparing yourself for future interviews, giving you the best chance possible to secure a great job at a top company. All of the largest companies in the software industry (Google, Facebook, Amazon, Microsoft, etc) will be looking for candidates who are great problem solvers, and the only way they can see if you're a great problem solver is by giving you programming challenges.

    So by entering these contests, you will ultimately become a better programmer and improve your employability prospects, all whilst having fun solving problems with other members here.

Scoreboard
  1. Gorzoid (58.50)
  2. jozefstodulski (45)
  3. silverbytevolt (12.73)

Since this is the first week, there will probably need to be some tweaking done. Perhaps the programming problems were too easy or too difficult. Or perhaps there weren't enough challenges to solve. Or maybe the timings were bad for some members here. These problems will be gradually ironed out over the coming weeks as I commence with future contests. I'm always open to hearing feedback as well, so either reply here or drop me a PM.




* - Ronan. - Mar 1, 2017

I'd advise creating your own problems, hackerrank solutions are readily available.
Codewars has a pretty good workflow for this, allowing you to port your challenges to multiple languages.


* - Haxalot - Mar 1, 2017

(Mar 1, 2017 03:23 PM)Ronan. Wrote:  I'd advise creating your own problems, hackerrank solutions are readily available.
Codewars has a pretty good workflow for this, allowing you to port your challenges to multiple languages.

I will not be wasting my time doing this. If a minority of members want to cheat to boost their ego, then so be it. Any obvious cheating will lead to them being disqualified and barred in future contests. These contests are only being hosted for the benefit of the members who do not want to cheat.


* - Haxalot - Mar 3, 2017

If anyone else is interested, the contest has just started.


* - Gorzoid - Mar 4, 2017

Currently #1 on leaderboard, that last one is tricky, I run out of memory calculating the set if N is greater than 4, not sure what the pattern is |:<


* - Haxalot - Mar 4, 2017

(Mar 4, 2017 04:27 AM)Gorzoid Wrote:  Currently #1 on leaderboard, that last one is tricky, I run out of memory calculating the set if N is greater than 4, not sure what the pattern is |:<

Congrats! I haven't attempted #5 yet (I will do later today), but it sounds like your solution is using the wrong time complexity. Given the size of the numbers involved, you're probably looking for an O(1) solution.

I've really enjoyed the other questions actually. #4 was brilliant - one of the best medium-style questions I've encountered thus far.


* - Gorzoid - Mar 4, 2017

Yeah I was using python to calculate every possible set from 0 to 2^5-1 and filter only the ones that xorsum'd to 0, it wasn't meant as a solution but just a way to find the pattern, I found the pattern and formula now but it requires alot of arbitrary precision arithmetic and thats quite difficult in C, which I did all my solutions in, and when tried to python it didnt seem to be work either.

4 wasn't too hard for me, it and 1 are the only ones I have 100% correct, there's just a few edge cases in 2 and 3 and im not sure what they are.


* - Haxalot - Mar 6, 2017

The contest is now over. The end leaderboard is:
  1. Gorzoid (58.50)
  2. jozefstodulski (45)
  3. silverbytevolt (12.73)
I'm happy to discuss any of the problems here for those who participated.