[JP Morgan] SDE OA

Distinct Digit Numbers

Given a range of integers, determine how many numbers have no repeating digits.

Example

n = 80
m = 120

The lower and upper bounds are inclusive, so there are 120 - 79 = 41 values in the range. Numbers without repeating characters are normal weight and others are bold. The two columns to the right are the valid number counts per row (normal weight) and invalid number counts (bold).

8081828384858687888991
9091929394959697989991
10010110210310410510610710810982
110111112113114115116117118119010
12010

There are 27 numbers with no repeating digits, and 14 other numbers in the range. Print 27.

Function Description

Complete the function countNumbers in the editor below.

countNumbers has the following parameter(s):
int arr[q][2]: integer pairs representing inclusive lower (n) and upper (m) range limits


我们长期稳定承接各大科技公司如TikTok、Google、Amazon等的OA笔试代写服务,确保满分通过。如有需求,请随时联系我们。

We consistently provide professional online assessment services for major tech companies like TikTok, Google, and Amazon, guaranteeing perfect scores. Feel free to contact us if you're interested.

Leave a Reply

Your email address will not be published. Required fields are marked *