Codenation

How many questions did you solved in Codenation hiring challenge which held on 21st Sep, 2019?

I solved 1 2 and 4. 3rd question was stuck in 9/15. No idea why. If anyone could solve 3rd, please explain your solution

1 Like

1 complete and 2 get stuck by 4/15

Can you explain how did u solved the 4th question?

1 Like

Does Any one has any idea on how many questions we need to solve to be selected for the next round?

It depends on rank…
If you have solved three problems…then there may be a chance

4th was same as 2nd. The main idea was that all the numbers could only be multiplied at max once by k, while it can be divided till it was indivisible. So any number could be transformed to at max 1 other value, if it’s not divisible by k. If divisible by k it can be reduced till it’s indivisible. From constraints, each number can have at max 32 possibilities to be changed. Now we have to choose one number such that the range is minimised.

Where can we see our ranks?

Could you explain the 1st one?

They is no rank visible to candidates.

How to solve that taker tree problem?

exact same…:frowning: I have also solved only 1st problem and second 4 test cases.

Can you give the impossible condition or test case of 2nd problem…BITLAND

Solution for third problem.

For last digit to be k, we need 10-k times 9. Because (10-k)(10-1)%10=k. Therefore we need 10-k numbers ending with 9. Now, you can take minimum sum for last digit to be k, as 9*(10-k). If number is greater than or equal to that value, we can solve it, otherwise we can’t. (For eg. 17 can’t be represented because we need minimum 3 numbers ending with 9)

3 Likes

can you explain your approach?

Anyone knows how to solve the last question ?

Bro, How many did you solved? If you solved the 5th one, can you please explain.

For 5th I used a bst with nodes storing the sum of the values in their subtree. Type 1 was adding a node to this bst and type 2 was querying it.

I was thinking the same , but werent we allowed to perform operations on more than one element of the array ?