Discussions on Codevita Solutions Will be penalized

Hiii to everyone
I have found a lot of people sharing solutions. As it costs the opportunities of others ranks it will not be encouraged at any cost. Because 1 rank below the line can cause Digital hiring of a person. So All the people who have shared solutions or logic will be penalized. Everyone Who attempted will be caught by our plagarism checker. And both of their attempts will be undone . This time we are not encouraging any type of plagarism at any cost. If many solutions caught from same college , All students from that college solutions are again sent for plagarism. So just try to solve on your own. Dont let your and your college repuation down.

Thank you.


Are you from the team codevita…

I have set one of the problem.


I hope it is fine now to discuss

Ofcourse you can carry on.

Thanks for participating.



which one??..

Are you working in TCS or just a problem setter

The Problem what i have set is Digit Pairs. Easy One.
No i am just a problem setter. I Have joined in Sprinklr.


is there any partial acceptance of test cases, or is it reflect in ranking

There will be no Partial acceptance.
If all the Sample and private test cases passed. You will get +1 else 0.

Ranking Procedure:

  1. Maximum Number of solved will be on top.

  2. If a tie occurs ,the one who solved the least solved problem will get better rank than the other.


can you tell you you applied for problem setter in codevita??

1 Like

I cannot tell you that. But all your experience matters. I have set problems in hackerearth.
I have selected gcj round 3 and hacker cup round round 2 in 2018 and 19 and experienced in setting problems for private contests.

All i can say that if your skills are beyond basic math and basic algos. You will get better opportunities.

Cheers .
All the best


ok thanks…thanks for shearing you exprience…

When will TCS show the Ranklist ???

After 20 days approx.

1 Like

Did anyone solve the problem SALARY PAID . I lost my mind while solving it :no_mouth: . If any solved it , please provide the solution with basic editorial [ If it is leagal to discuss now ]

Thanks in advance :slight_smile:

1 Like

I solved it. What problem did you face? Is it about figuring out the solution or not getting accepted or anything else?

1 Like

I am unable to get how to find out the unknowns . I tried many ways to form the equations . Any how , everytime i end up having 2 unknowns :neutral_face:

Ok! I did not form any equations.
First I calculated the maximum tax for each slab
like for
300000 600000 900000 (slabs)
10 20 30 (percentage)
I would form an array like the following
for 300000-600000 max tax = (600000-300000)*10/100 = 30k
for 600000-900000 max tax = 300000 * 20/100 = 60k
This means if someone is paying 30k tax, then his/her salary would be exactly 600000 or if someone is paying exactly 30k + 60k = 90k tax, his/her salary would be exactly 900000

so what I did next was, take a variable salary and initialize it to slab[0] (300000 in the sample case). Here I am assuming that no one’s salary can be below slab[0] which is a pure assumption of mine which matched with the assumption of the problem setter also by chance.
next, I took the tax paid, and started subtracting from it the max tax for each slab until I could not subtract it anymore or I subtracted the max taxes for all slabs. Concurrently, I am also adding the range of slab in salary.
for example if tax paid = 100k,
I would subtract from it max tax for first slab so tax paid = 100 - 30 = 70k
and I would add (600000 - 300000) in salary and then there are some terminating conditions.
Here’s my code
Note: I have pushed an extra element at the end of maxTax which is infinite.
vector slab, percentage, maxTax, salaryVector;
int rebate;

int calculateSalary(int tax){
    int salary = slab[0];
    unsigned int i;

    for(i=0; i<maxTax.size(); i++){
        if(tax < maxTax[i] || i == maxTax.size()-1){
            salary = salary + (tax*100)/(percentage[i]);
            //cout << i << " " << salary << endl;
            salary = salary + (maxTax[i]*100) / percentage[i];


    return salary+rebate;

Let me know if you don’t understand anything.


If anyone needs now, here are the solutions to the four problems i solved.
Bit Score
Bottle Necks
Dole out cadbury
Friend circle required very tedious recursive implementation and car optimization was 4 dimensional interval scheduling dp which i also didn’t solve.
If anyone has some easy (short) implementation of these two problems please share here.

1 Like