There is an array A consisting of N two-digit numbers. You can choose any number from the array and replace it with its

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

There is an array A consisting of N two-digit numbers. You can choose any number from the array and replace it with its

Post by answerhappygod »

There is an array A consisting of N two-digit numbers. You canchoose any number from the array and replace it with its reversedversion. You can apply this operation as many times as you want.What is the maximum number of distinct numbers that can becreated?
In python 3!!
Write a function:
class Solution { public static int solution(int[] A);}
that, given an array of N integers, returns the maximum numberof distinct numbers that can be represented after reversing theorder of any number of integers.
Examples:
Assumptions:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply