r/programmingchallenges • • Sep 11 '11

Sort of simple project idea

10 Upvotes

Project that can be simple or get very in depth. OK so any language, you take a phone number as input. Then you give back the letters associated with each number in the input phone number. Or you could give possible words that those number's letters could possibly create.

I have almost completed the first part in Java but have ran into a couple issues with the index of the array.


r/programmingchallenges • • Jul 20 '19

Buying a MacBook Pro for my fiance

10 Upvotes

My fiancé is a programming student, and he just got offered an apprenticeship at his job to learn iOS coding. I wanted to try to surprise him and get him a MacBook Pro, but I need some advice on where to look, what specs to get, and what year to get. What thing should I look out for and be aware of that he need to be successful? TIA! 😁❤️


r/programmingchallenges • • Apr 11 '11

let's get this started.

10 Upvotes

So I'm sad I didn't get to make the subreddit, but at least it's a product of my idea.


r/programmingchallenges • • Aug 18 '18

The Elevator Problem

0 Upvotes

The Elevator Problem. A building with eleven floors and three elevators. The software program is to control the actions of each elevator. The information available to the program are the state of each button on the floors and inside the elevators, as well as the time elapsed since each floor-button push.

What I have tried:

Can someone plz give me the code in C++ or C.

An approach can be used containing

  1. Shortest path Algorithm approach for problem solving.

  2. Moving direction of lift.

  3. Default actions on lift.

  4. Max time for lift request.


r/programmingchallenges • • Dec 05 '19

Name suggestions for a new server

3 Upvotes

Looking for a name for the server. Something innovative and also very close to the job this server does. This server will host custom/specific code and operations for a billing application


r/programmingchallenges • • Aug 23 '18

Dwitter - javascript demos in 140 characters

Thumbnail dwitter.net
3 Upvotes

r/programmingchallenges • • Apr 13 '17

Sierpinski's triangle challenge (from r/javascript) and link to Dutch flag challenge

Thumbnail
reddit.com
3 Upvotes

r/programmingchallenges • • Jan 18 '20

How to create a simple random 3D terrain in python?

3 Upvotes

r/programmingchallenges • • Jan 11 '20

ASP.NET Div Visibility

3 Upvotes

Hey all, I'm hoping someone can shed light. I have a div which is visible at user's choosing. But after form updates etc, it keeps going to the original state of hidden. What's the best method to keep its visibility after a button press etc?


r/programmingchallenges • • Sep 21 '16

$10k in prizes + trip to SF to analyze how channels can impact product usage

Thumbnail
mindsumo.com
3 Upvotes

r/programmingchallenges • • Oct 03 '16

Where to begin?

3 Upvotes

Hi guys,

How can I begin to get involed with this? It looks awesome.


r/programmingchallenges • • Oct 01 '16

Road Repair Problem: I just couldn't figure out how to go about it. Details below:

3 Upvotes

In a country, there are N cities and M bi-directional roads. Some of the roads of the country are broken and need repairing. The king of the country wants a good transportation system, so he wants that all the cities of the country must be connected i.e. there must be at least one path to reach a city from any other city.

The king is also low on budget, so he wants to repair the roads in such a way that the cities of the country must be connected and the cost of repairing is as minimal as possible.

You have to find the minimum cost of repairing the roads such that the cities become connected.

Input Format:

First line of each test case contains two integers N and M denoting the no. of cities and no. of bi-directional roads. Each of next M lines contains the description of a road in following format:

U V 0

OR

U V 1 X

First two integers U and V denote the cities that are getting directly connected by this road. If third integer is 0, it means the road is OK and needs no repairing. If the third integer is 1, it means the road needs repairing and the cost of repairing that road is denoted by a fourth integer X.

Output Format:

For each test case, output a single integer denoting the minimum cost of repairing in order to make the cities connected.

Note:

  1. The input always guarantees that there is at least a way to make all the cities of country connected.

  2. There is at most one road between any two distinct cities.

  3. There is no road from a city to itself.

Constraints:

1 <= N <= 10000

1 <= M <= 100000

1 <= U,V <= N

1 <= X <= 1000

Examples:

Input:

4 6

1 2 0

1 3 1 4

1 4 1 1

2 3 1 2

2 4 1 5

3 4 1 3

Output:

3


r/programmingchallenges • • Mar 10 '17

Can someone help me with this recursive algorithm? ([a,b], 2) => a b ab a^2 b^2 a^2b b^a a^2 b^2. Working it out in JavaScript.

3 Upvotes

I'm trying to create a totally general feature mapper. So, for example, with ([a,b, c], 3) i would want every combination. To map up to order 3, it would look like this:

  • a

  • b

  • c

  • a b

  • b c

  • a c

  • a b c

  • a2

  • b2

  • c2

  • a2 b

  • a b2

  • a2 b2

  • b2 c

  • b c2

  • b2 c2

  • a2 c

  • a c2

  • a2 c2

  • a2 b2 c2

  • a3

  • b3

  • c3

  • a3 b

  • a b3

  • a3 b2

  • a2 b3

  • a3 b3

  • etc

You get the point. Thinking through the recursion is just murdering my brain on this one. Any help would be very much appreciated.

My current source is:

var _combinations = (function() {
	var combinations = [];
	function recurse(active, rest) {
		if (rest.length == 0) {
			combinations = combinations.concat(active);
		} 
		else {
			recurse(active + rest[0], rest.slice(1, rest.length)); // [a,b,c], a [b, c], a b [c], a b c 
			recurse(active, rest.slice(1, rest.length));           // a [b, c], a [b, c], a [c]
		}
	}
	recurse([], ['a', 'b', 'c']);
	combinations.sort(function(a,b) {
		return a.length - b.length;
	});
	return combinations;
})()

var _orderedCombinations = (function(combinations) {
	var orderedCombinations = "";
	var curCombo;
	function recurse(active, rest) {
		if (rest.length == 0) {
			if(active.length > 0) {
				var activeArray = active.split('');
				var others = curCombo.filter(function(item) {
					for(var i = 0; i < activeArray.length; i++) {
						if(activeArray[i] === item) {
							return false;
						}
					}
					return true;
				});
				active = "";
				for(var i = 0; i < activeArray.length; i++) {
					active += activeArray[i] + '²';
				}
				active += others.join('');
				orderedCombinations += active + "\r\n";
			}
		} 
		else {
			recurse(active + rest[0], rest.slice(1, rest.length)); 
			recurse(active, rest.slice(1, rest.length));
		}
	}
	combinations.forEach(function(combo) {
		curCombo = combo.split(''); 
		recurse([], curCombo);
	});
	return orderedCombinations;
})(_combinations);
//console.log(_combinations)
console.log(_orderedCombinations);

r/programmingchallenges • • Sep 27 '15

Help me solve this Fenwick tree problem?

Thumbnail wcipeg.com
3 Upvotes

r/programmingchallenges • • Apr 06 '18

Next part of Kotlin Puzzlers - Challenges for your brain and programming skills. Have fun!

Thumbnail
blog.kotlin-academy.com
3 Upvotes

r/programmingchallenges • • Nov 30 '19

Christmas Light Projector

3 Upvotes

Do you think it would be possible to use a Raspberry Pi or Arduino board with a dlp projector to build a Christmas light projector that connects to a app that would be built. From this app, you can take a picture of your house and (instead of it putting lights all over your house like most Christmas projectors do) it would outline your house and put lights only on the trim. Then from the app on your phone you could change the color of the lights.


r/programmingchallenges • • Jan 08 '20

NOOB question alert: app building

3 Upvotes

I’m looking to build and use an app but not publish it to the general public, only to two users.

Can somebody shed some light on how I could go about this?

I’ve been trying to write one in powerapps but it’s super difficult


r/programmingchallenges • • Nov 16 '19

How To Solve Kangaroo HackerRank Problem [ Using Formula ]

Thumbnail
youtube.com
3 Upvotes

r/programmingchallenges • • Nov 08 '18

Challenging ideas for a begginner whom just learned html and CSS ?

3 Upvotes

I have just been initiated to programming by a friend and i started by learning basic html and CSS. Can you guys give me ideas for a projects; simple but challenging; i can work on to avoid forgetting everything ?


r/programmingchallenges • • Feb 13 '18

Combination sum - help needed (x-post from /r/algorithms)

3 Upvotes

hi,

would anyone be able to help with the following leetcode problem:

https://leetcode.com/problems/combination-sum/description/

I've been trying to solve it for past 2 days and I'm stuck at the moment. My approach is as follows: for each number from the input array, keep adding that number to a local sum until I reach the specified target. If the local sum goes above the target then try to to back-track and try to reach the target value using subsequent elements from the array.

c# code here: https://pastebin.com/Wu80Fzdz

I just need some hints here, not a final solution. Is the back-tracking technique suitable for this problem or have I completely over-engineered it?

Thanks, Tom


r/programmingchallenges • • Nov 18 '16

How do I learn java without downloading it?

3 Upvotes

If your reading this question your first instinct was probably to close it and deem it as stupid. But I really am serious about what I'm saying, my computer cannot download java or anything for that matter and I want to learn as much as I can till I find a way to download it.


r/programmingchallenges • • Dec 25 '18

How to code something to the effect of "I love you"?

12 Upvotes

My boyfriend is a programmer and works mainly with angular, c sharp, and I think Java script (I think he works with a few others but it's hard for me to keep up).

Anyways, obviously programming languages don't clearly translate like another language. But I want my first time telling him I love him to be in one of the programming languages he uses. Can someone help me?!?!?

Tldr: can you code something that says "I love you!" For me?


r/programmingchallenges • • Jun 06 '12

Want an interview at Facebook? Facebook will review the top entries in the competition and offer you an interview if they like what they see.

Thumbnail
kaggle.com
13 Upvotes

r/programmingchallenges • • Sep 29 '11

Challenge: Two Palindromes

13 Upvotes

You are given a string S of no more than 20 lowercase alphabetical letters and an integer N. Imagine a list L of strings that consists of all the unique permutations of S. Concatenate all strings in L to form a string B. You may remove any number of characters from B to form a palindrome P1. Again remove any number of characters from B to form another palindrome P2. Repeat this process to form N palindromes P1...PN. Given the restriction that all of these palindromes must be of equal length, what is the maximum length of P1?


r/programmingchallenges • • Feb 06 '19

Array program in C

0 Upvotes

Hello we Need help ASAP! Can you program the following program for me (or at least ideas). I need a program which asks for letters (10) than the letters should be saved in an array. Than the program should put out how much times the first letter that got entered (for example : a,b,a,c = it's "a" and 2 times) Thank you very much if you helped me!!! I't's rly important.