Skip to content

Conversation

@mtonina
Copy link

@mtonina mtonina commented Jan 27, 2026

Hi @conanbatt

First case: I implemented three approaches (I'm learning Typescript so I took the opportunity to experiment). I used a different approach for non-additional-datastructure requirement. Instead of running linear, I sort the string so I can fix it with O(nlog(n)) complexity. I provide other two solutions (one with extra data structure and TS, and other with pure JS). I'm an old Java guy, so I'm trying to move to javascript and force myself to learn it to improve my skills.

Second scenario: I made it with a different approach, I guess it can be a little more complicated (I use a Set and a hash instead of two hashes) but I avoid traversing all the second hash again to check that it's 0 in all keys. In addition, I added a new test case to check if someone forgot to validate set/hashmap at the end. It can lead to false positives without this check.

I added a different approach for solving exercise 3 -with an array and replacing it in place, trying to use the original idea of mutable structure-. I hope it help to expand the combination of solutions.

All the other exercises are done with my approach trying to achieve the minimum time complexity.

@mtonina mtonina changed the title 01 and 02 - Proposal My solutions and proposals Jan 29, 2026
@mtonina mtonina changed the title My solutions and proposals My solutions and proposals for strings Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant