• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
June 10, 2022 |7.7K Views

Array Pair Sum Divisibility Problem | SDE Sheet | Hashing

Description
Discussion

In this video we will see how to write a function that returns true if a given array can be divided into pairs such that the sum of every pair is divisible by a given number k.

Examples:
Input: arr[] = {9, 7, 5, 3}, 
k = 6 
Output: True 
We can divide the array into (9, 3) and 
(7, 5). Sum of both of these pairs 
is a multiple of 6.

Check out the video to see how we implement this!!


Practice Problem: https://practice.geeksforgeeks.org/problems/array-pair-sum-divisibility-problem3257/1
Article: https://www.geeksforgeeks.org/check-if-an-array-can-be-divided-into-pairs-whose-sum-is-divisible-by-k/
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/