Coding challenge #1 - Win SBD if you solve the problem!
This is my first 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!
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.
I hope you enjoy it at much as I do.

The first problem is not going to be very difficult.
Contest #1
- Write a function that take as argument a char array and modify it so that the order of the letters is reversed.
- For instance: 'abc def' ---> 'fed cba'
- Write a function that take as argument a char array and modify it so that the order of the letters in the words are reversed.
- For instance: 'abc def' ---> 'cba fed'
You can assume the separator between words is always the space (no comma, dot, ...)
The preferred language to use is Java, but you can also use other languages as well. You will need to translate the starting code to the language of your choice. Don't use languages where you can solve the problem natively in one line ;)
Rules
- Submit your solution:
- Open the starting code (in java): https://pastebin.com/e9ibTNgf
- or create something similar in another language if you prefer
- EDIT: for javascript, you can use this: https://pastebin.com/QcP0snbK
- Edit the code to solve the challenge. You could use online tools like https://repl.it/languages/java to write and test your solution directly in the browser
- Submit a link to your code on https://steemit.chat by DM @armandocat
- Specify your steem account name. If you win, I will deposit the prize there.
- Once I try your code, I may help you with suggestions on how to fix problems or make your code better.
- Open the starting code (in java): https://pastebin.com/e9ibTNgf
- You cannot use built in function. You need to work on the array at low level (i.e. using for, while, array read and write at indexes, ...)
- 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.
- 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 ;)
- I have all the rights to disqualify any suspected cheating players.
Rewards
The liquid reward of this post will be divided between the working solution submitted in this way:
- The most time- and space-efficient, well-written solution will get 50% of the liquid reward of this post
- The second will get 25%
- The third will get 12.5%
- ...
- Well, let's say that if you end up in
nth position, you will get1/2^n% - If two or more solutions are considered a tie, the time the solution is submitted decide how wins (the first solution submitted wins)
You have 7 days to submit your answer!
Good luck!
Armando 🐾
I very rarely think in words at all. A thought comes, and I may try to express it in words afterwards.
- Albert Einstein
EDITED
1.1 You don't have to post the solution as a comment
1.2 You should not use functions like split and join.. You need to work on the array to exchange the position of the letters
The payout will be in 7 days.
If you want to partecipate write me on steemit.chat
I edited the post adding the code to work the solution in javascript:
https://pastebin.com/QcP0snbK
You can use this as a starting point
Thanks. My bad for the mishap.
I like your preferences very much. You are a smart guy
I have followed you on Steemit, please be kind enough to follow me as well.
Submitted. Great challenge. This should be regularly organised.
When will be next problem provided
I'll probably do another one later this week 😼