Giter Club home page Giter Club logo

javascript-wordcountengine-codingchallenge's Introduction

WORD COUNT ENGINE CODING CHALLENGE

πŸ“— Table of Contents

πŸ“– WORD COUNT ENGINE

WORD COUNT ENGINE is a medium difficulty coding challenge that I found on PRAMP. Test your profficiency with strings and arrays.

πŸ›  The Challenge

Implement a document scanning function wordCountEngine which receives a string document and returns a list of all unique words in it and their number of occurrences, sorted by the number of occurrences in a descending order. If two or more words have the same count, they should be sorted according to their order in the original sentence. Assume that all letters are in english alphabet. You function should be case-insensitive, so for instance, the words β€œPerfect” and β€œperfect” should be considered the same word. The engine should strip out punctuation (even in the middle of a word) and use whitespaces to separate words.

Analyze the time and space complexities of your solution. Try to optimize for time while keeping a polynomial space complexity. Examples: input: document = "Practice makes perfect. you'll only get Perfect by practice. just practice!"

output: [ ["practice", "3"], ["perfect", "2"], ["makes", "1"], ["youll", "1"], ["only", "1"], ["get", "1"], ["by", "1"], ["just", "1"] ]

Important: please convert the occurrence integers in the output list to strings (e.g. "3" instead of 3). We ask this because in compiled languages such as C#, Java, C++, C etc., it’s not straightforward to create mixed-type arrays (as it is, for instance, in scripted languages like JavaScript, Python, Ruby etc.). The expected output will simply be an array of string arrays.

Constraints:

[time limit] 5000ms [input] string document [output] array.array.string

Tech Stack

Language

πŸ’» Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

In order to run this project you need:

 npm install
 Nodejs

Setup

Clone this repository to your desired folder:

  cd JavaScript-WordCountEngine-CodingChallenge
  git clone https://github.com/JonahKayizzi/JavaScript-WordCountEngine-CodingChallenge.git

Run tests

To run tests, run the following command:

  npm run test

OR

Submit a pull_request and ensure that all auto_checks pass

logo

(back to top)

πŸ‘₯ Authors

πŸ‘€ Jonathan Kayizzi

(back to top)

🀝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Contribute my providing more optimal approaches with better performance and time complexity

(back to top)

⭐️ Show your support

If you like this project you can give me a ⭐️

(back to top)

πŸ™ Acknowledgments

I would like to thank Pramp for this coding challenge

(back to top)

πŸ“ License

(back to top)

javascript-wordcountengine-codingchallenge's People

Contributors

jonahkayizzi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.