I want to build a "invite score" software write on Scala and using concepts of funcional programming where:
- The inviter gets (1/2)^x for each confirmed invitation where x is the level of the invitation: evel 0 (people directly invited) yields 1 point, level 1 (people invited by someone invited by the original customer) gives 1/2 points, level 2 invitations (people invited by someone on level 1) awards 1/4 points and so on.
- If a person receive multiple invites, only the first one will count.
- To count a valid invitation, invited person must have invited someone;
Ex.:
So, given the input:
1 2
1 3
3 4
2 4
4 5
4 6
The score is:
1 - 2.5 (2 because he invited 2 and 3 plus 0.5 as 3 invited 4)
3 - 1 (1 as 3 invited 4 and 4 invited someone)
2 - 0 (even as 2 invited 4, it doesn't count as 4 was invited before by 3)
4 - 0 (invited 5 and 6, but 5 and 6 didn't invite anyone)
5 - 0 (no further invites)
6 - 0 (no further invites)
The program input will be a text file where each person identifier will follow the format "INVITER\tINVITED".
Hello Sir,
I am a computer science tutor, I teach (among others) Scala and Algorithms.
I have done many projects like this, and I'm one of the top Scala developers, and you can check by clicking on my profile picture.
Please contact me for more details when possible.
I look forward to work for you Sir.
Best Regards.