Creating Strings I - CSES Introductory Problems #13
In this video, I solve the problem 'Creating Strings I' from https://cses.fi/problemset/task/1622 Comment any better ideas! The template I use can be found at https://cdn.samyok.us/usaco/template.cpp.txt. I also stream at https://twitch.tv/oksammyoak, so follow me there! I stream everything from web design to Minecraft :) ========================================== Here's the Problem Statement: Time limit: 1.00 s Memory limit: 512 MB Given a string, your task is to generate all different strings that can be created using its characters. Input The only input line has a string of length n. Each character is between a-z. Output First print an integer k: the number of strings. Then print k lines: the strings in alphabetical order. Constraints 1n8 Example Input: aabac Output: 20 aaabc aaacb aabac aabca aacab aacba abaac abaca abcaa acaab acaba acbaa baaac baaca bacaa bcaaa caaab caaba cabaa cbaaa
In this video, I solve the problem 'Creating Strings I' from https://cses.fi/problemset/task/1622 Comment any better ideas! The template I use can be found at https://cdn.samyok.us/usaco/template.cpp.txt. I also stream at https://twitch.tv/oksammyoak, so follow me there! I stream everything from web design to Minecraft :) ========================================== Here's the Problem Statement: Time limit: 1.00 s Memory limit: 512 MB Given a string, your task is to generate all different strings that can be created using its characters. Input The only input line has a string of length n. Each character is between a-z. Output First print an integer k: the number of strings. Then print k lines: the strings in alphabetical order. Constraints 1n8 Example Input: aabac Output: 20 aaabc aaacb aabac aabca aacab aacba abaac abaca abcaa acaab acaba acbaa baaac baaca bacaa bcaaa caaab caaba cabaa cbaaa