Programming Challenges

!challenges

@programming.dev
Create post
[Medium] String Decompression Solutions Counter

[Medium] String Decompression Solutions Counter

Given a compressed string, give the number of ways it can be decompressed.

  • A compressed string is a string where substrings of repeated characters are changed to a format similar to aaa -> a3
  • For example for the string aaabbhhhh33aaa the compressed string would be a3b2h432a3

As an example of counting decompressing options. Say you have the input a333b2. This can be read as a333 b2 or a3 33 b2 so you would need to return the value 2 as there are 2 options.


You must accept the input as a command line argument (entered when your app is ran) and print out the result

(It will be called like node main.js aaaaa or however else to run apps in your language)

You can use the solution tester in this post to test you followed the correct format https://programming.dev/post/1805174


Checking through the solutions of last weeks problems should be happening this weekend monday + tuesday. Been getting too much work and theres a game jam thats been going on but should be able to go through them all then. I may do the easy one last since it cant be checked using the solutions tester so that one will take a bit longer.

Will also try to go through and give solutions to these ones as well on the weekend and will try to do solutions as soon as possible from now on so you can see if you failed the test cases. For the ones done last week, after I go through them all ill give 1 extra day from then on for any resubmissions

[Easy] String Compression

[Easy] String Compression

Given a string, compress substrings of repeated characters in to a format similar to aaa -> a3

For example for the string aaabbhhhh33aaa the expected output would be a3b2h432a3


You must accept the input as a command line argument (entered when your app is ran) and print out the result

(It will be called like node main.js aaaaa or however else to run apps in your language)

You can use the solution tester in this post to test you followed the correct format https://programming.dev/post/1805174

Any programming language may be used. 1 point will be given if you pass all the test cases with 1 bonus point going to whoevers performs the quickest and 1 for whoever can get the least amount of characters

To submit put the code and the language you used below


People who have completed the challenge:

[Hard] Longest Valid Bracket Pattern

[Hard] Longest Valid Bracket Pattern

Given some assortment of brackets, you must find the largest substring that is a valid matching bracket pattern

  • A bracket match is an opening and closing version of the same kind of bracket beside each other ()
  • If a bracket matches then outer brackets can also match (())
  • The valid brackets are ()[]{}

For example for the input {([])()[(])}()] the answer would be ([])() as that is the largest substring that has all matches


You must accept the input as a command line argument (entered when your app is ran) and print out the result

(It will be called like node main.js [(]() or however else to run apps in your language)

You can use the solution tester in this post to test you followed the correct format https://programming.dev/post/1805174

Any programming language may be used. 3 points will be given if you pass all the test cases with 1 bonus point going to whoevers performs the quickest and 1 for whoever can get the least amount of characters

To submit put the code and the language you used below


People who completed the challenge:

submissions open for another day (since the last time I edited the post)

[Med] Bracket Match Generation

[Med] Bracket Match Generation

Bracket Inc. wants to ship out new products using their excess brackets. They have tasked you with generating every possible assortment of brackets for some n brackets where the brackets will match

  • A bracket match is an opening and closing version of the same kind of bracket beside each other ()
  • If a bracket matches then outer brackets can also match (())
  • n will be an even number
  • The valid brackets are ()[]{}

For example for n = 4 the options are

  • ()()
  • (())
  • [][]
  • [[]]
  • {}{}
  • {{}}
  • []()
  • ()[]
  • (){}
  • {}()
  • []{}
  • {}[]
  • ({})
  • {()}
  • ([])
  • [()]
  • {[]}
  • [{}]

You must accept n as a command line argument (entered when your app is ran) and print out all of the matches, one per line

(It will be called like node main.js 4 or however else to run apps in your language)

You can use the solution tester in this post to test you followed the correct format https://programming.dev/post/1805174

Any programming language may be used. 2 points will be given if you pass all the test cases with 1 bonus point going to whoevers performs the quickest and 1 for whoever can get the least amount of characters

To submit put the code and the language you used below

Programming Challenge Solutions Tester

Programming Challenge Solutions Tester

Open link in next tab

GitHub - Ategon/P.D-Challenge-Tester: A CLI to test solutions for the https://programming.dev programming challenges community

https://github.com/Ategon/P.D-Challenge-Tester

A CLI to test solutions for the https://programming.dev programming challenges community - GitHub - Ategon/P.D-Challenge-Tester: A CLI to test solutions for the https://programming.dev programming ...

GitHub - Ategon/P.D-Challenge-Tester: A CLI to test solutions for the https://programming.dev programming challenges community
Mods and Helpers wanted!

Mods and Helpers wanted!

Hey everyone,

Currently looking for some more help with this community. Out of all of them I'm running for the instance this one by far takes the most work since it involves checking peoples code against tests.

I'm starting work on some generic testing systems for various languages (will do another post about that soon) that should help reduce the amount of work but if anyone else wants to help me create and run the challenges let me know (or if anyone wants to help out with running the tests with peoples code and giving them results)

Theres a matrix room for this community at https://matrix.to/#/#p.d-challenges:matrix.org

[Easy] Bracket Simplification

[Easy] Bracket Simplification

Welcome to the first programming challenge! Three of these will be posted a week and you can complete it in any language you want.

You get a point for completing an easy challenge, 2 for a medium, and 3 for a hard. For each challenge if you solve it in the least amount of characters you get a bonus point, and if your code runs the fastest when I check it you also get a bonus point. (ties mean everyone who tied gets the bonus point although exact duplicate answers wont count)

Ill be posting a leaderboard that will show the people who have the most points every month

Submissions will be open for a week


As a new hire of bracket inc., you have been tasked with getting rid of excess brackets lying around the facility. You must simplify a series of brackets so that only brackets that dont have a match remain (a match is an opening and closing bracket of the same type beside each other). The final result should have no matches

As an example for the input [(({})({)(()}] the expected output would be [(({)(}]

These are the valid types of brackets: (){}[]

Your system will be tested against 10 different unknown test cases before it is unleashed on the facility. In order to complete this task you must pass all of the test cases.

Any programming language may be used and to submit an answer reply on this post with the code and the language you coded it in

Edit: Clarification, you must take input in from the user using the program instead of them being hardcoded. (makes it easier to test)

Welcome to the Programming Challenges community!

Welcome to the Programming Challenges community!

This is a community that will have various programming challenges to complete (in any language of your choosing)

Posts will be done three times a week (one easy, one medium, one hard) with the first easy one coming tomorrow

I'm currently running the community until somebody else volunteers but if anyone else wants to manage it let me know