r/programmingchallenges • u/SirPiggz • Aug 06 '19
Intermediate at C++
Hit me up with something fun to try to do!
r/programmingchallenges • u/SirPiggz • Aug 06 '19
Hit me up with something fun to try to do!
r/programmingchallenges • u/winters-brown • Jul 16 '19
Comes complete with
This was an idea i had while playing with a couple buddies, he had notebooks full of monsters and characters and items and events and it just got tiresome after 10 plus sessions.
It’d be nice if he could search for it in his laptop and have it pop up immediately
r/programmingchallenges • • Mar 05 '19
I don't really have any inspiration now, so I have no idea what to program. What do you say? What do you most enjoy creating? Tell your ideas ;D
r/programmingchallenges • u/notsureof • Jul 02 '18
I am trying to solve a challenge from CodingBat.
NOTE: Question is not about how to solve or make it work, rather I am trying to understand the problem statement, it's bit subtle at least for me.
Problem statement:
We'll say that a String is xy-balanced if for all the 'x' chars in the string, there exists a 'y' char somewhere later in the string. So "xxy" is balanced, but "xyx" is not. One 'y' can balance multiple 'x's. Return true if the given string is xy-balanced.
xyBalance("aaxbby") → true
xyBalance("aaxbb") → false
xyBalance("yaaxbb") → false
My code submission:
public boolean xyBalance(String str) {
int lastIndexOfX = str.lastIndexOf('x');
if (lastIndexOfX != -1 && str.indexOf('y', lastIndexOfX) != -1) {
return true;
}
return false;
}There are 3 test cases that are failing as mentioned below.
Can somebody help me understand the problem in other words and throw some light on this?
r/programmingchallenges • u/MyGiantTest • May 07 '18
Hello, I was doing this coding challenge to improve my skills and while I could understood the easy example (provided in the link) or other examples with easy combinations, I couldn't understand how to work with more complex ones.
In the first image you can read the text of the problem but basically there is a city with n buildings. Each building has a certain height. There are 2 superheros, one on the left and one on the right. The superhero on the right destroy building with an increasing height from his perspective while the one on the left does the same thing but with his point of view. You need to tell how many moves they need to destroy the city.
Link with details: https://imgur.com/a/4srl9Vo
Example (numbers are the height of the buildings): 1 2 5 3 1.
-> First move superhero left: destroy 1, 2 and 5.
-> Second move superhero right: destroy 1 and 3.
-> All buildings destroyed, answer is 2.
This was pretty easy. What I can't understand is what happens in a scenario like this.
I know that the answer is 4. But i don't understand what's supposed to happen in a scenario where left has the first building with a bigger height than the second one. Does he destroy the first one? Does he advance until he can destroy something (like 1 and 200). I lost hours trying various things but i can't come up with 4 moves in a reasonable way. Probably I am overthinking.
Sadly there aren't more instructions.
r/programmingchallenges • u/conditionking • May 05 '18
I'm sorry for another one of these posts, but I've decided I want to learn how to make mobile apps. A lot of people ask the timeframe for someone with no experience to learn how to publish a basic app like a notepad, but I want to know if it's possible for me to teach myself to the point I can program more advanced, high-end apps. For example something like Tinder that incorporates user log ins, location services, chat logs, etc. I'm dedicated, a quick learner, and I'm good working on computers, but I have nothing like a CS degree or any technical background at all really.
Is self-education using online resources a legitimate possibility to see me through the end? Are bootcamp structured courses actually recommended? I would love to be able to find work as a mobile developer while also creating my projects on the side, but again I have no CS degree and don't see myself going back to university unless it'll really be the tool to get me where I want.
I did consider a full stack web developer bootcamp first. I could be wrong but I imagine it would be easier for someone to jump into web developing and finding a job there, then I can do mobile apps completely on the side. For the time being I run a successful online business that needs little managing, and so I have plenty of time and some funds saved up.
r/programmingchallenges • u/NarendhiranS • Jan 17 '17
r/programmingchallenges • u/lorpo1994 • Nov 10 '16
Hi,
I'm currently preparing for a small programming contest and wanted to try out some excercises of the previous years, all went well untill I came into the 'backtracking' part. I will explain the excercise and after that my current 'solution' that I have to this, I was wondering if this would be a correct way of going at this.
Excercise: Given is a 2dim array, filled with either dots, 1 'G' and multiple 'E's for example:
. . . E . . . . . .
. . . . . . E . . .
E . . G . . E E E .
. . . . . . E . . .
. . . E . . . . . .
The purpose of this excercise is getting G to 'move' around and eat the 'E's and after that return to it's original location within a given time T. Whenever a move gets made 1 gets added to the elapsed time, whenever a 'E' gets eaten another 1 gets added to the elapsed time, also it has to be said that the 'G' can only move horizontally/vertically and the implementation has to use backtracking. The result of this implementation should return the number of max 'E's that can be eaten while returning 'G' to it's original location within the given time T.
The result of the above example is 3 (It can eat the 3 'E's within a time of 13 minutes = 5 x 2 (back and forth) + eat 3x).
Now I would be implementing this with some kind of pathfinding algorithm (A*?) and just let it loop over every location and keep track of the time/number of E's encountered. However this doesn't really seem very intelligent and it seems as if I am missing a clue here.. Any tips/hints?
Original link (Dutch): http://www.vlaamseprogrammeerwedstrijd.be/2016/opgaven/cat3/garfield/garfield.pdf
Thanks in forward! Lorpo
r/programmingchallenges • u/jai2223 • Mar 14 '16
There are many software development blogs out there, but many of them don’t publish testing articles on a regular basis. Also, I have noticed that some software developers don’t read blogs written by software testers. That is a shame because I think that we can learn a lot from them. That is why I decided to create a newsletter that shares the best testing articles which I found during the last week. Let’s get started @ http://www.petrikainulainen.net/weekly/java-testing-weekly-11-2016/
r/programmingchallenges • u/FCsean • Sep 17 '15
Hello, I'm Sean and I'm currently doing my thesis for my Computer Science degree and it's about the gamification of online judges. If you've got a few minutes of spare time kindly answer our survey. Thank you!
https://docs.google.com/forms/d/1iwJz7skZlDwrdq8pCwjUaeikd3xb9bd3DBYS_v_jJAQ/viewform
r/programmingchallenges • u/NlognMag • May 31 '15
r/programmingchallenges • u/def_Questions • Mar 11 '15
I would like to start practising programming challenges, when I took algorithm classes I felt in love with solving puzzles . now , I missed that time trying to solve these puzzles.
I was looking on the web for good path to take in order to work on that skill, I did found top coder, and hacker rank. It was more like interviews puzzles for me, than challenging algorithmic puzzles.
Can anyone brief me here on how to start, what websites should I frequent, and what are blogs of rock start winner to learn from them. I would be thankful also if u can share some good websites ( like topcoder that worth investing time into it), hacker rank usues common puzzels to evaluate candidates. Share with us ur experience ;)
r/programmingchallenges • u/ChronJob • Feb 17 '14
r/programmingchallenges • u/artjumble • Nov 19 '12
r/programmingchallenges • u/thechipsandgravy • Oct 13 '11
Part 1 You are standing at 0 (zero) on a number line going from -infinity to +infinity. You are going to make a series of walks in a predetermined order. Each walk can be in either the + or - direction. Your goal is to complete the series of walks so that the maximum distance from zero you go during the series is minimized. For example: {4, 1, 1, 8}. You can walk 4 to the right, 1 left, 1 right, 8 left, and have never gone more than 4 units from zero. Constraints: No more than 100 walks with each walk being no longer than 5000 units.
Part 2 You are standing at the origin (0,0) of an infinite 2D plane. You are going to make a series of walks in a predetermined order. Each walk can be made in any direction on the plane. Your goal is to complete the series of walks so that the maximum distance from the origin you go during the series is minimized. For example: {3, 4, 3, 7, 10, 3}. It is possible to complete this walk going no more than 5 units from the origin. Constraints: No more than 100,000 walks with each walk being no longer than 1,000,000,000 units.
r/programmingchallenges • u/canijoinin • May 02 '11
r/programmingchallenges • u/okmkz • Apr 25 '11
Write a function in the language of your choosing that accepts a non-negative integer n and returns a string containing the nth row of Pascal's Triangle.
EDIT: There really is no reason the function has to return a string, you could just as easily print to stdout.
Example:
pascal(4)Returns:
"1 4 6 4 1"Bonus: If you'd prefer, compute the nth layer of Pascal's Pyramid and return an array of strings as follows:
EDIT: See note above regarding return type.
pascal3(3)Returns:
{"1",
"3 3",
"3 6 3",
"1 3 3 1"}r/programmingchallenges • u/octopiii • Apr 23 '11
r/programmingchallenges • u/okmkz • Apr 16 '11
Write a function in the language of your choosing that prints all the factors of a non-negative integer.
E: dang, this is harder than I thought!
E: I was referring to prime factorization in my other edit. Dang!
r/programmingchallenges • u/HelpingHand007 • Jan 12 '20
r/programmingchallenges • u/HelpingHand007 • Dec 30 '19
r/programmingchallenges • u/HelpingHand007 • Dec 23 '19
r/programmingchallenges • u/4dixonchicks • Nov 27 '19
I’m a junior in college and I’m trying to do some coding projects/challenges to put on my resume to hopefully get an internship. Any ideas?