Giter Club home page Giter Club logo

kata-mafia-family's Introduction

kata-mafia-family

Just a Kata designed for some colleagues they want to have some training.

Problem to solve:

Just imagine you're "The Punisher", the man who is fighting against the crime with no help from anybody! but you could get a file with info about the main mafia families from the Police Station (no ask how you did it)

But the thing is, the data isn't sorted, and the kind of info you have there is something like this:

Alphonse Grabriel;Capone;Scarface;Capone;Leader
Richard;Perotti;Richie Blue Eyes;Capone;Bad Ass
Michael J.;Spillane;Mickey;Westies;Leader
Igor;Gasparov;The Giant;Tambov gang;Sergeant
Vladimir;Kumarin;;Tambov gang;Leader

There you can see how the info is sorted as follow:

  • Name
  • Last Name
  • Nick
  • Family
  • Level

Levels can go from Leader/Counselor/Sergeant/Bad Ass. Assuming the next:

  • There is only one Leader per family, and two Counselors per leader
  • There are only two Counselors per family but they have in addition two Sergeants
  • But the Sergeants have their own gang of badasses
  • The badasses are shown in the file immediately after their Sergeant

Punisher is interested then in having an application that allow to him to parse the info inside the stolen file, so that, he could have every single family sorted out by levels. That it could be pretty fancy because he could easily select new targets to punish

Just from the initial file, generate a new file (one per family) a write there the info from the Leader to the Badasses. Please don't write just plain text, choose a structure that allow nesting (xml or json?) to make the task of reviewing the families as simple as we can

Resources

Just go to the "to-punish/" folder, there you'll see the file with the info of people to punish

Remember

Feel free of using your preferred programming language to code (java, kotlin, php, js...) Feel free of using your preferred building tool to build (maven, gradle, ant...) Feel free of using your preferred IDE (IntelliJ, Eclipse...) BUT:

  • Please try to go for the simplest solution
  • Please provide any kind of tests to check your solution
  • Bear in mind, a solution with a complexity greater than O(n^2) would be considered as poor (in fact from my point of view, even n^2 is too much)

kata-mafia-family's People

Contributors

geeksusma avatar

Watchers

James Cloos avatar johnjaymoor avatar  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.