O ( M ^ 2 ) time complexity C ++ program to find count of subsequences of size three divisible by M .
#include <iostream> NEW_LINE using namespace std ; int countSubSeq ( int A [ ] , int N , int M ) { int ans = 0 ;