Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,207,518 members, 7,999,313 topics. Date: Monday, 11 November 2024 at 12:55 AM |
Nairaland Forum / Science/Technology / Programming / Regular Programming Challenges With The Odd Money To Win (2481 Views)
Codewars.com Coding Challenges / Programming Challenges / New To Python, Gurus Please Help Solve These Challenges. Thanks. (2) (3) (4)
Regular Programming Challenges With The Odd Money To Win by faucon(m): 3:32pm On Nov 12, 2019 |
I want to use this as a medium to be posting regular programming challenges to stimulate our brains and just for fun. Perhaps you can use this as an opportunity to improve your problem-solving skills and to improve your skills in an existing or a new programming language. To spice things up, occasionally there will be challenges with deadlines in which money can be won. There can only be 1 winner and it will be the first person to answer all the problems in the challenge correctly. You’ll receive the money through PayPal or bank transfer You can submit your answers in any programming language but obviously I’d prefer C, Java or Python only because it’s easier for me. I will be publishing the first set of challenges once I’m done finalising the questions. This one will have somebody winning £50 if the correct answers are put forward within 5 days. Before I send out the first challenge, I’d give some time to answer any questions or provide more clarifications if required. |
Re: Regular Programming Challenges With The Odd Money To Win by General0847: 3:51pm On Nov 12, 2019 |
Interesting. |
Re: Regular Programming Challenges With The Odd Money To Win by shotin(m): 3:57pm On Nov 12, 2019 |
hmm.... That's good, waiting for more update... |
Re: Regular Programming Challenges With The Odd Money To Win by stanliwise(m): 5:09pm On Nov 12, 2019 |
let me nor say anything. |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 6:29pm On Nov 12, 2019 |
stanliwise:no you have to say something now |
Re: Regular Programming Challenges With The Odd Money To Win by stanliwise(m): 9:58pm On Nov 12, 2019 |
faucon:What's your aim?, why are we submitting codes to you? Why are you paying us? |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 11:45pm On Nov 12, 2019 |
stanliwise:To stimulate things here and ascertain people's approach to solving problems and reward occasionally. Perhaps scout for future projects I may have. |
Re: Regular Programming Challenges With The Odd Money To Win by ANTONINEUTRON(m): 6:59am On Nov 13, 2019 |
wen are u posting the first challenge |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 11:34am On Nov 13, 2019 |
ANTONINEUTRON:first challenge coming in less than an hour |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 12:37pm On Nov 13, 2019 |
First Challenge Please post all the answers to the questions in one go, it will be easier for me and everyone else to go through and will avoid having to collate pieces of your answers in the thread. Only the second question under Quiz doesn’t require you to code your answer. As for which programming language to use, preferably C, Java or Python but you’re free to use whichever you’re comfortable with. There is only 1 winner. First to get all answers correctly before November 20 by 23:59 PM wins £50. I’ll send it to the winner’s PayPal account if they have one or the equivalent in Naira to their Nigerian account. Quiz 1. We denote "A in base b": Ab. What is the result, in base 10, of 102 + 108 + 1016? Note only the value in base 10, without specifying the base. 2. Which of these dates cannot be represented using a timestamp on a UNIX system? a. 2 March 1969 b. 2 December 1970 c. 13 January 1997 d. 25 August 1991 e. I don't know 3. If you write all the numbers from 1 to 999 in a row by separating the numbers by points (1.2.3.4.5.6.7.8.9.1.0.1.1.1.2 ...), how many points will be immediately surrounded by odd numbers? 4. What is the 1000th integer that has the number of 1's as a prime number in its binary representation? Reminder: 1 is not first. 5. What is the biggest whole number strictly lower than 421337 that generates the longest Collatz conjecture? Problem Subject Dayo's car has a technical problem: his right turn signal is constantly working, impossible to stop. Wanting to respect the rules of the road, he decides to always take the first right. Being equipped with a state-of-the-art car model with an integrated navigation assistant, Dayo asks you to write an application that tells him which direction to take when he arrives at a roundabout. You are given the coordinates of the roundabout, and a list of coordinates representing the different destinations of the roundabout exits. The car arrives at the roundabout from the first of these destinations in the list. Write a function that returns the coordinates of the destination of the exit that corresponds, from Dayo's point of view, to the first exit of the roundabout. Input The Input will include: • on the first line, the X, Y coordinates of the roundabout, separated by a space; • on the second line, the number N of exits on the roundabout; • on the third line, the coordinates X1, Y1 of the part of the road in which the car arrives, separated by a space; • on the following N - 1 lines, the coordinates Xi, Yi of the destinations of each of the exits, separated by a space. Output You will display in your output: • the coordinates of the destination of the exit corresponding to the first exit of the roundabout. Constraints • 2 ≤ N ≤ 10,001; • each coordinate is a whole number and between -10,000 and 10,000; • the coordinates all lead to different directions: the roads (the right segments from the roundabout to their destinations) do not overlap. Runtime constraints Maximum memory usage: 5000 kilobytes Maximum execution time: 500 milliseconds Input/output samples Sample input 1 1 4 1 0 1 2 0 1 2 1 Sample output 2 1 Note Refer to image.
|
Re: Regular Programming Challenges With The Odd Money To Win by OutOfTheAshes(m): 7:40pm On Nov 13, 2019 |
Where are the developers... food don done o |
Re: Regular Programming Challenges With The Odd Money To Win by silento(m): 8:57pm On Nov 13, 2019 |
Waiting for people |
Re: Regular Programming Challenges With The Odd Money To Win by ANTONINEUTRON(m): 10:25pm On Nov 13, 2019 |
That last problem though.... |
Re: Regular Programming Challenges With The Odd Money To Win by ANTONINEUTRON(m): 3:05pm On Nov 14, 2019 |
Advance Data structure is one thing local man will be learning next semester, and the way he'll focus on it..... At this point. I throw in the towel. But I achieved something at least. That last problem is a no go area for me. As for question.4, It's not clear to me. 1. Using java.
Output: 47 Note: The program takes the last number 1016 as base 6. 2. option a is the answer. Because Unix timestamp starts counting at 1st, January, 1979 3.Using java
Output: 1440 4. Not clear. Because all 1000th numbers have 1 in their binary representation. 5.Using java
Output: 421336 6. There's time for everything in this life. Please after this competition ends explain how this problem can be solve. Thank you. |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 4:57pm On Nov 14, 2019 |
@ANTONINEUTRON Good going man on being the first to show some result. Don't throw in the towel yet. 1. It's not correct. Please look at the bases for each number. Sorry I didn't format it correctly at first. Also pay attention to the curly brackets, I had to restructure them before running your code. 2. You're right but care to tell us why? 3. It's not correct 4. I'm asking for the 1000th integer that has the number of 1's as a prime number in its binary representation. 5. Your approach is not entirely wrong but you're incorrect. You're close though. 6. Yeah sure. I'm also quite interested to see how people will solve it. I used a naive approach and probably someone may come up with something better. |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 10:07pm On Nov 16, 2019 |
I was expecting more answers to be coming in right about this time, what's happening? |
Re: Regular Programming Challenges With The Odd Money To Win by gbolly1151(m): 8:04am On Nov 17, 2019 |
Hope am not too late to the party? |
Re: Regular Programming Challenges With The Odd Money To Win by OutOfTheAshes(m): 9:36am On Nov 17, 2019 |
faucon:Because we have more developers than programmers. Those questions require a high level of problem solving skill. I am trying to wrap my head around them. Don't expect much from Nairalander developers. |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 12:48pm On Nov 17, 2019 |
No one is late to the party still. Also with the new info I have got, I have decided to extend the deadline to November 20. I'll update the main post. 1 Like |
Re: Regular Programming Challenges With The Odd Money To Win by gbolly1151(m): 2:12pm On Nov 17, 2019 |
Here is my answers,i will be updating them as i will be solving them I am coding in python 1.
Output : 26 2. The answer is (a) UNIX timestamp system start with 1,January 1970 , all dates before that will result in negative value 3.
Output: 775 4. I am trying to analyze is this way, the 1st integer number with 1's as prime number in its binary is 3, the 2nd integer is 7 The this code will work for the 1000th integer
Got into an inifinite loop for valves greater than 8 on my PC For output of 1st,2nd and 3rd integer The output are 3,7,31 respectively |
Re: Regular Programming Challenges With The Odd Money To Win by Kaylhey20: 11:04pm On Nov 17, 2019 |
Hi everyone, I tried solving the questions and I arrived at answers for all of them. Although my algorithm may not be the best, I'm just in my first semester of studying Comp. Science in the US. So, the answers are as follows: 1) Output is 26 2) The epoch for time reference on a UNIX system is 1st January, 1970. So option a) will result in negative time . ;( , Answer is (a). 3) Output is 775 4)Output is 1990 5)Output is 410011 6) I solved it using the concept of gradients, and my output is 2 , 1 as stated. I tried posting my code, but the formating is bad. OP if you can check through my answers, I can share you the file and you can go through my code. Thanks. #QUESTION 1 2 Likes |
Re: Regular Programming Challenges With The Odd Money To Win by gbolly1151(m): 9:06am On Nov 18, 2019 |
Hmm....loving those questions |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 11:26am On Nov 18, 2019 |
gbolly1151 and Kaylhey20 both of you are getting very close. But which of you would arrive first ? Kaylhey20 use the hashtag sign to format your code properly or write your code inside "["code"][\code]" (remove quotes) It would come out like this
|
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 5:25pm On Nov 18, 2019 |
gbolly1151:Your approach to the 4th question is not correct. To help you out a bit the sequence is 3,5,6. Refactor your code a bit and use print statements to see where you're going wrong. That's all I can say for now. |
Re: Regular Programming Challenges With The Odd Money To Win by Kaylhey20: 5:45pm On Nov 18, 2019 |
Thanks, @faucon. I have updated it, but are the answers correct. 1 Like |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 7:29pm On Nov 18, 2019 |
Kaylhey20:Congratulations, you're the first to answer all the questions correctly. How long did it take you to answer all the questions? I will PM you for your £50 prize. 1 Like |
Re: Regular Programming Challenges With The Odd Money To Win by 4kings: 7:51pm On Nov 18, 2019 |
Awesome job guys! |
Re: Regular Programming Challenges With The Odd Money To Win by Nobody: 8:00pm On Nov 18, 2019 |
Thief! Only out to steal source codes. Proof of prices won? |
Re: Regular Programming Challenges With The Odd Money To Win by Kaylhey20: 8:41pm On Nov 18, 2019 |
faucon:About an hour and 30 minutes, but the last one took the longest time. |
Re: Regular Programming Challenges With The Odd Money To Win by gbolly1151(m): 8:42pm On Nov 18, 2019 |
Congrat @kaylhey20 |
Re: Regular Programming Challenges With The Odd Money To Win by gbolly1151(m): 8:47pm On Nov 18, 2019 |
I really learn alot from this challenge let it keep coming @faucon |
Re: Regular Programming Challenges With The Odd Money To Win by faucon(m): 10:27pm On Nov 18, 2019 |
Kaylhey20:I have replied your PM please check. |
Please Help An Upcoming Programmer / Contribute What You Know About Artificial Intelligence / How To Get A User IP Address With Javascript
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 62 |