Unable to find hackerearth hiring challenge problem

Few days back i participated in mercedes-Benz hackereath hiring challege (challenge is closed) and stumbled across a problem statement which i was not able to solve and also not able to find it on web. I don't remeber exactly complete problem statement, nevertheless i will try to explain here.

Closest Special number

Given a number n, find closes special number where special number meet below conditions.

  • each char in number must repeat same num of time. For eg: if "23" are the chars then the closest number would be "22333"
  • number of unique even chars must be equal to num of unique odd chars

Eg:

9 --> 22
10 -> 22
24 -> 122
1000 -> 1 4444 (both conditions are met)

Can anyone help me to find similar problem

Comments (1)