Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kristijorgji/challenge1
My solution to the problem described in the readme section. An algorithmic problem in which you have to parse nodes and form json string from them.
https://github.com/kristijorgji/challenge1
Last synced: about 1 month ago
JSON representation
My solution to the problem described in the readme section. An algorithmic problem in which you have to parse nodes and form json string from them.
- Host: GitHub
- URL: https://github.com/kristijorgji/challenge1
- Owner: kristijorgji
- Created: 2015-12-10T21:38:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-17T21:05:39.000Z (about 9 years ago)
- Last Synced: 2023-03-03T21:22:06.018Z (almost 2 years ago)
- Language: C#
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Challenge 1
This is my solution in C# for the following challenge problem. You are welcomed to provide your own solutions in this repo. I would love to check them out and find out the most efficent way of solving this problem.
The problem:
You are required to implement an algorithm that recursively builds JSON based on the input.
The input is given in the following form:
//.../
//.../
...
//.../
where m,l,k >= 0Sample input:
a/b/c1
x/b
a/b/c/d
mOutput:
{
a: {
b: {
c: {
d: ""
},
c1: ""
}
},
x: {
b: ""
},
m: ""
}*Note that ordering of nodes in the output does not matter
**Also, first you can do preprocessing, then apply the recursive algorithm.