The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Bheem and his friends were playing with numbers in the jungle but suddenly there came a storm, all the trees started displacing from their places, animals running here and there to survive the storm. Yes it was Kirmada back again to conquer Dholakpur, the only kingdom left in the world that was not conquered by him. He challenged Bheem again to save Dholakpur as this time Kirmada was even stronger than earlier, but this time the challenge was not to fight against him to save Dholakpur but the challenge was with numbers.
With his magical power Kirmada concatenated all the number from 1 to N and gave Bheem a number k and challenged him to tell the digit at kth index in the concatenated number. Help Bheem win this challenge and save Dholakpur.
Â
Â
Â
Â
Â
Input: 2 10 5 15 16 Output: 5 1
Â
Example case 1. concatenating all numbers from 1 to 10 gives 1234567810 and the 5th digit in the concatenated number is 5.
Example case 2. concatenating all numbers from 1 to 15 gives 123456789101112131415 and the 16th digit in the concatenated number is 1.
Note: The problem originally belongs to one of the Google Interview Questions.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll