×

# Need help with a Coding Contest Problem

 0 A Prime Array is an array which doesn't contain a pair of numbers whose product isn't a square of an integer. For eg [1,2,3] is a Prime Array but [1,2,4] is not. Explanation : 1*4 gives 4 which is square of 2. Given an array of integers determine the minimum number of operations to convert the array to a Prime array. NOTE: An operation consists of either increasing or decreasing any element of the array by 1 but the element should always be positive. Constraints: Length of array <=100 1 <=Each integer in array <=1000000 Eg. Array => [1,1,2] Minimum operations to convert [1,1,2] to [1,2,3] is 2. asked 19 Nov '18, 03:31 1●1 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×798

question asked: 19 Nov '18, 03:31

question was seen: 234 times

last updated: 19 Nov '18, 03:36