×

# How to find all possible K values for the given problem?

 0 Given an array of N integers. a[1]%K = a[2]%K = a[3]%K = .... a[n]%K 1) 1

 1 Hint: if $a_1 \text{ mod } K = a_2 \text{ mod } K$, then $(a_1 - a_2) \text{ mod } K = 0$. Therefore $K$ has to be a divisor of $a_1 - a_2$. answered 10 Aug '17, 03:19 591●5 accept rate: 22%
 0 Can you please give some Q link? People need it to verify that this isnt related to an on-going contest. I will be happy to help after that :) answered 09 Aug '17, 19:52 15.2k●1●18●59 accept rate: 18% It is not related to ongoing contest. Link (09 Aug '17, 19:58) check_me3★ Thanks!! :) (09 Aug '17, 20:06)
 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:

×1,175
×921
×836
×333
×57

question asked: 09 Aug '17, 19:11

question was seen: 330 times

last updated: 10 Aug '17, 03:19