Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 673 Bytes

File metadata and controls

21 lines (17 loc) · 673 Bytes

Inverse Of An Array

Easy


  1. You are given a number n, representing the size of array a.
  2. You are given n numbers, representing elements of array a.
  3. You are required to calculate the inverse of array a.
  4. The inverse of a number is defined as the number created by interchanging the face value and index of digits of number.
  5. The key constraint is if the number is 5 digits long, it'll contain all the digits from 0 to 4 without missing any and without repeating any.

Example 1:

Input:  n = 5, a[] = {4, 0, 2, 3, 1}  
Output:  array- {1, 4, 2, 3, 0}

Constraints:

0 <= n < 10^7