Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: March 28, 2024, 5:04 pm

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Here's a simple programming problem for you to solve
#1
Here's a simple programming problem for you to solve
Question:
Write a program(preferably in c)to:
*Input a string S of x length with each letter denoted by l1,l2,l3,...lx.
*Input integer variable z.
*Display all possible non -repeating combinations of the individual letters of the string S as strings of length z( in no particular order.)

Example 1:

(input string) "AB"
(input integer variable) 2
(display result)
"AA"
"BB"
"AB"
"BA"

Example 2:


(input string) "AB"
(input integer variable) 1
(display result)
"A"
"B"

Example 3:


(input string) "AB"
(input integer variable) 3
(display result)
"AAA"
"BBB"
"AAB"
"ABA"
"BAA"
"BBA"
"BAB"
"ABB"


I actually solved this problem, well, partially solved, my solution was very buggy and outputted many many duplicate strings. Let's see if someone can solve this :-)

Iterative and recursive answers are accepted, iterative answer gets 5 points, recursive answer gets 4 points and both of the answers submitted by a single person gets 25 points. (I know, I know, my point scheme doesn't make any sense, that's not the point)
Reply
#2
RE: Here's a simple programming problem for you to solve
Nope, won't do your homework for free. My fee is 5000 euros.
Reply
#3
RE: Here's a simple programming problem for you to solve
I'll do it for 4000.
The fool hath said in his heart, There is a God. They are corrupt, they have done abominable works, there is none that doeth good.
Psalm 14, KJV revised edition

Reply
#4
RE: Here's a simple programming problem for you to solve
Not my homework in case anyone's wondering!
Reply
#5
RE: Here's a simple programming problem for you to solve
That's the first thing I thought too.:-)
Reply
#6
RE: Here's a simple programming problem for you to solve
If this is not your homework, why are points assigned for it?

You are asking if people are smart enough to solve a 1st-year programming problem, but you don't think we're smart enough to know that it's a 1st-year programming assignment?


Big Grin
Reply
#7
RE: Here's a simple programming problem for you to solve
(April 26, 2016 at 9:24 am)bennyboy Wrote: If this is not your homework, why are points assigned for it?

You are asking if people are smart enough to solve a 1st-year programming problem, but you don't think we're smart enough to know that it's a 1st-year programming assignment?


Big Grin

No no, I assigned points so that it will motivate you lazy people!
Reply
#8
RE: Here's a simple programming problem for you to solve
I program all day for a living. I am trying to find time and motivation in the evenings to work on my AI. I have absolutely no motivation to program anything that I don't have to. Sorry.
Reply
#9
RE: Here's a simple programming problem for you to solve
^^^ this ^^^
Reply
#10
RE: Here's a simple programming problem for you to solve
Well how about atleast some clues? Like don't actually write a program but like type it in simple short English?
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  Cryptocurrency in simple details. WinterHold 49 3148 September 10, 2021 at 11:02 am
Last Post: Spongebob
  Programming Language Swift Poll Shining_Finger 24 4162 December 2, 2015 at 7:21 pm
Last Post: bennyboy
  Programming Question Shining_Finger 8 1359 December 2, 2015 at 5:30 pm
Last Post: Tiberius
  Programming the Human Mind: Shining_Finger 21 4565 November 24, 2015 at 7:56 pm
Last Post: bennyboy
  Anyone into Android programming? emjay 97 17909 September 20, 2015 at 6:50 am
Last Post: bennyboy
  Advice Sought for Web Programming AFTT47 13 3256 April 4, 2015 at 10:41 pm
Last Post: bennyboy



Users browsing this thread: 1 Guest(s)