Enabled in this fork
same to same with different words
the joy of coding 😂 feel your pain
The expected output is in string.
expected [ { name: 'red', id: '1' }, { name: 'yellow', id: '2' }, { name: 'black', id: '3' }, { name: 'white', id: '4' } ] to equal
'[{name : 'red', id : '1'}, {name : 'yellow', id : '2'}, {name : 'black', id : '3'}, {name : 'white', id : '4'}]'
Can any one please help me
i tried to find fking mistake about 20 mins in my own same code. I wrote Javascript instead of JavaScript....
Javascript
JavaScript
Approved
You forgot to add quotes around names and id, not a kata issue!
python new test framework is required. updated in this fork
Look at my faster solution without explicit sort. )))
The expected test results should probably be more like: "[{'name': '1', 'id': '1'}, {'name': '2', 'id': '2'}, {'name': '3', 'id': '3'}, {'name': '4', 'id': '4'}]"
Regex to the rescue. Most times brings you clean, simple and readable solutions like this to table. Well done!
The overall time complexity of this solution is O(N!â‹…NlogN).
Brute force should've been stated in the description of the code, but it does encourage people to write more efficent code.
I initally decided to generate all of the permutations and then give back the next biggest one but tests stopped me from doing that.
Not the most efficent one but probably the cleanest. Although some comments would've helped
Loading collection data...
Enabled in this fork
same to same with different words
the joy of coding 😂 feel your pain
The expected output is in string.
expected [ { name: 'red', id: '1' }, { name: 'yellow', id: '2' }, { name: 'black', id: '3' }, { name: 'white', id: '4' } ] to equal
'[{name : 'red', id : '1'}, {name : 'yellow', id : '2'}, {name : 'black', id : '3'}, {name : 'white', id : '4'}]'
Can any one please help me
i tried to find fking mistake about 20 mins in my own same code. I wrote
Javascript
instead ofJavaScript
....Approved
You forgot to add quotes around names and id, not a kata issue!
python new test framework is required. updated in this fork
Look at my faster solution without explicit sort. )))
The expected test results should probably be more like:
"[{'name': '1', 'id': '1'}, {'name': '2', 'id': '2'}, {'name': '3', 'id': '3'}, {'name': '4', 'id': '4'}]"
Regex to the rescue. Most times brings you clean, simple and readable solutions like this to table. Well done!
The overall time complexity of this solution is O(N!â‹…NlogN).
Brute force should've been stated in the description of the code, but it does encourage people to write more efficent code.
I initally decided to generate all of the permutations and then give back the next biggest one but tests stopped me from doing that.
Not the most efficent one but probably the cleanest.
Although some comments would've helped
Loading more items...