Let's see how smart is Sup Forums

let's see how smart is Sup Forums

>input two strings
>output string with maximum number of maximum length alphabet substrings

for example:

aabb
caddbb
=
abcd abd ab b

This is how coding is thought at universities, folks.

Don't be that guy. Work on practical problems instead.

>alphabet substrings
What the fuck do you even mean like that?
I cannot see the pattern that caused those inputs to return those outputs.
>3D Image
Disgusting.

jesus christ, you input any two strings and make mini alphabets with the letters you have

>string with maximum number of maximum length alphabet substrings

if you want us to do your homework, just post it word-for-word. because you're not making sense pajeet.

So you just return the set of characters that occurs in both strings?
That seems too trivial to be even slightly interesting.

>make mini alphabets with the letters you have

wtf?

why is the second part of the output "abd" instead of "abc"? why is the last part "b" instead of "a"?

ok eng is not my language and I just made this problem up, took me 2 mins

how can't you retards understand this kys everybody

>how can't you retards understand this
Your explanation is fucking terrible. It's not obvious at all why that input leads to that output.
Why don't you post some code that does whatever the fuck you're talking about?

test

test2

>output string with maximum number of maximum length alphabet substrings
>you input any two strings and make mini alphabets with the letters you have

So basically take a bunch of strings and then pull as many A-Z alphabets out of them as you can?

I think I see what you're getting at, but sweet Christ you could've explained it a whole lot better considering you're asking Sup Forums to do your homework. Also, Pajeet detected. So, without further ado,

DESIGNATED

I think he's backpedaling because he realizes there isn't any logic behind what he came up with.

output seriously makes no sense.

omfg how to do?

not homework I just made it up you faggot

>So basically take a bunch of strings and then pull as many A-Z alphabets out of them as you can?

yes ffs

i think what he is asking is use all of the letters to make "mini alphabets".
So, if there is
aabbcc
it would be
abc abc

Your output still makes no fucking sense.

>college tier problems

Real problem is you have 500 terabytes of data in mysql and you need to transfer to a nosql mongodb

SHITTING

This. OP doesn't actually want to make a point on the intelligence of Sup Forumsangsters but instead wants to have someone do their homework.

STREETS

>hurrr homework

I made that shit up, you fags can barely understand the problem, I give up, you can't solve this

it's square brackets I think. not

will smith

If the task is now over, can you show the code that does the correct thing? You do have it, right?

I'm thinking since your initial input string can come in any order, use a hash table with buckets (linked lists) in which the hash function is that the ascii value of the character - some constant (so that 'a' gets put at index 0). That way you have a sorted hash table with whatever number of a's, b's etc. Then from there go through the table, pulling one letter if the bucket has something or moving to the next bucket if nothing is present. When you reach the end of the table, you start over on your next string. At the end the table is empty and you have all the useless mini alphabets and you can jo to your algo skills in peace

test 3 [\code]

test 4

Delete your posts after you're done fucking with code brackets.

yeah something like that, delete the bucket when empty to reduce operations

Do your own fucking homework. That;s a typical homework-style question.

>[{test{} test} \code(TEST_) } ]

>break down string
>sort letters alphabetically

loop:
>determine number of unique characters in string
>get one character from parent string, remove it from parent and put it into a new string
>check with the unique character counter, if your string has less characters, proceed to cut another character that is not contained within your new string
>else print the new string
>repeat loop

Now be a good boy and do your homework

>O(nlogn)
Thanks for your time. Don't call us; we'll call you.

Prove you're not a faggot and do it in O(1) space. If you can't can't you should just drop out desu

So take the letters, make the biggest sequential alphabet possible, then use the remaining letters to make more

who is this sweet pajeet?

She's Lebanese. Still a degenerate, though.

O(1) is impossible as you need to iterate through all the letters but you can do it easily in O(n) (counting sort + 1 iteration)

Ah you're correct. I was thinking this was a common dynamic programming problem with an O(1) space solution, but you are correct. It can be done with an array of size n, where n is the length of the smaller of two strings

This thread is fucking terrible.

wait why the fuck are there two string inputs if we're making alphabet substrings based on both strings? input ['abcd, efgh'] is identical to ['abcde', 'fgh'] is identical to ['abcde', defgh'] is identical to ['abcdefgh', '']

anyways sorting a string is n log n time so i don't think it can be done any faster although i'd like to be pleasantly surprised

this is a great solution! i would have never thought of that
-3rd year computer engineering student

testing
testing
testing

int main()
{
string in1, in2, in3;
vector nig(26, ""), ger;
cin >> in1;
cin >> in2;

in3 = in1 + in2;

for (auto i : in3) {
nig[i-'a'] += i;
}
for (auto i : nig) {
int count = 0;
for (auto j = 0; j < i.size(); j++) {
if (j >= ger.size()) {
string tmp = "";
tmp += i[0];
ger.push_back(tmp);
} else {
ger[count] += i[0];
}
count++;
}
}
for (auto i : ger) {
cout

So what the fuck is a real world problem? Someone graduates with a degree in CS, what do they do as their job?

i struggled with this as well. Really depends on the company and the services they offer or want to create. There are so many things you can do, especially when there's data to play with.

making websites and database APIs for corporations.

I've seen her with a penis inside her and she seemed to enjoy it, so I don't think she's lebanese. Definitely straight.

I've been look around for how to calculate the big O for this but I'm not sure, is it n^2 because of the nested loops? Is it less because it isn't iterating over the same data twice? I'm not finding much to go on as far as formally figuring it out, just rules of thumb and guidelines.

Traveling salesman

Nice.

you could cat the strings, sort it, and implement an unbalanced binary tree. Insert characters one at a time, equal goes left, larger goes right. For remove(node), prioritize replacing the current node with the left child node. Otherwise replace with the right node. Then for print, just start at the top and print then delete each right node until everything is gone.

Only issue is the input strings need to be sorted. Would be decently fast otherwise I think.

This was a fun problem. thx OP. Hope you get a good grade you fucking cheater.

We had the same solution, is my implementation worth a shit, or are there better ways to do it?

My implementation: