FastPrepDecimal Digits in Order

Decimal Digits in Order

ZoomInfo logoZoomInfo● EasyFULLTIMEPHONE SCREEN
Learn

Problem statement

Return the decimal digits of value from most significant to least significant. Ignore a negative sign. The value zero has the single digit 0.

Function

decimalDigits(value: long) → int[]

Examples

Example 1

value = 0return = [0]

The decimal magnitude directly determines the ordered digit sequence.

Example 2

value = 7return = [7]

The decimal magnitude directly determines the ordered digit sequence.

Example 3

value = 42return = [4,2]

The decimal magnitude directly determines the ordered digit sequence.

Constraints

  • -10^18 <= value <= 10^18.

Source note: Author-written prompt excerpt retained for source fidelity.

More ZoomInfo problems

See ZoomInfo hiring insights
public int[] decimalDigits(long value) {
    // Write your code here.
}
value0
expected[0]
Checking account…