This is my second contest about coding problems. I find coding problems very interesting and I really enjoy solving them, so I thought: I must not be the only one!
<p dir="auto">So here I am, writing you some of the problems I found myself working on in job interviews, or competitions I took part in the past.<br /> I hope you enjoy it at much as I do. <p dir="auto"><center><span><img src="https://images.hive.blog/768x0/https://steemitimages.com/DQmQGxeECpik7rVwtMCWndk8cKE4QEemqjRSSKk5NoTn2q8/question-mark-2123968_640.jpg" srcset="https://images.hive.blog/768x0/https://steemitimages.com/DQmQGxeECpik7rVwtMCWndk8cKE4QEemqjRSSKk5NoTn2q8/question-mark-2123968_640.jpg 1x, https://images.hive.blog/1536x0/https://steemitimages.com/DQmQGxeECpik7rVwtMCWndk8cKE4QEemqjRSSKk5NoTn2q8/question-mark-2123968_640.jpg 2x" /> <p dir="auto">This problem is similar to that of last week, but in some way trickier.<br /> Have fun! <h1>Contest #2 <p dir="auto">In a <strong>Linked list, each <em>node has a value and a next node.<br /> Given a Linked list: <ol> <li>Write a function that reverse the linked list, using a <strong>recursive algorithm. <li>Write a function that reverse the linked list, using a <strong>iterative algorithm. <ul> <li>For instance: given A -> B -> C it returns C -> B ->A <p dir="auto">You don't have to clone the nodes, you must just work on their <em>next properties. <p dir="auto">The preferred language to use this time is <em>javascript, but you can also use other languages as well. You will need to <em>translate the starting code to the language of your choice. <h2>Rules <ul> <li>Submit your solution: <ul> <li><ul> <li>or create something similar in another language if you prefer <span>Open the starting code (in javascript): <a href="https://pastebin.com/tHBtHZVF" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://pastebin.com/tHBtHZVF <li><span>Edit the code to solve the challenge. You could use online tools like <a href="https://repl.it/languages/javascript" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://repl.it/languages/javascript to write and test your solution directly in the browser <li><ul> <li>Specify your steem account name. If you win, I will deposit the prize there. <li>Once I try your code, I <em>may help you with suggestions on how to fix problems or make your code better. <span>Submit a link to your code on <a href="https://steemit.chat" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">https://steemit.chat by DM <a href="/@armandocat">@armandocat <li>You cannot use built in function. You need to work on the linked list at <strong>low level (i.e. using for, while, ...) <li><strong>Don't post your solution in the comments. If you do, you will be disqualified. Everyone should work on the problem by himself/herself. I will post the best solutions after the competion is ended. <li>I'm the judge. I'll try to be as objective as possible, but it's possible that the coding style I like could be different from what somebody else likes. However, I make the contest, I decide who wins ;) <li>I have all the rights to disqualify any suspected cheating players. <h2>Rewards <p dir="auto">The liquid reward of this post will be divided between the working solution submitted in this way: <ul> <li>The most time- and space-efficient, well-written solution will get 50% of the liquid reward of this post <li>The second will get 25% <li>The third will get 12.5% <li>... <li>Well, let's say that if you end up in <code>nth position, you will get <code>1/2^n% <li>If two or more solutions are considered a tie, the time the solution is submitted decide how wins (the first solution submitted wins). Or I can decide to split the rewards equally, for instance if two contestant are considered winners, I may sum the 1st and 2nd price and divide the 75% of the liquid reward between the two. <p dir="auto">You have 7 days to submit your answer!<br /> Good luck! <p dir="auto">Armando 🐾
congrats to the winners
Yay, another coding challenge. Hope you don't mind that I entered again. 🙂
You are more than welcome ;)
@armandocat Your generate up is spectacular. Mad regard for sticking as a result of many of the hardships, Many of us would've Give up A great deal before. Upvoted.
I am a bot!
Solution Submitted
Submitted
Cool another coding challenge!