Showing:
Handle Score
@Ibrahim Nash 6560
@mb1973 5777
@Quandray 5271
@akhayrutdinov 5111
@saiujwal13083 5074
@kirtidee18 4356
@sanjay05 3762
@mantu_singh 3638
@gfgaccount 3601
@marius_valentin_dragoi 3525
Nth character in Concatenated Decimal String
Easy Accuracy: 75.51% Submissions: 49 Points: 2

If all decimal numbers are concatenated in a string then we will get a string which looks like string P as shown below. We need to tell Nth character of this string.
P = “12345678910111213141516171819202122232425262728293031….”

Example 1:

Input: N = 10
Output: 1
Explaination: From the given portion of the
string you can see that the 10th character is
'1'.

Example 1:

Input: N = 11
Output: 10
Explaination: From the given portion of the
string yuou can see that the 11th character is
'0'.

You do not need to read input or print anything. Your task is to complete the function NthCharacter() which takes N as input parameter and returns the Nth character of the string P.

Expected Time Complexity: O(logN)
Expected Auxiliary Space: O(1)

Constraints:
1 ≤ N ≤ 105