Find the K | C ++ programme to find the K 'th minimum element from an array concatenated M times ; Function to find the K - th minimum element from an array concatenated M times ; Sort the elements in ascending order ; Return the K 'th Min element  present at ( (K-1) / M ) index ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int KthMinValAfterMconcatenate ( int A [ ] , int N , int M , int K ) { sort ( A , A + N ) ; return ( A [ ( ( K - 1 ) / M ) ] ) ; } int main ( ) { int A [ ] = { 3 , 1 , 2 } ; int M = 3 , K = 4 ; int N = sizeof ( A ) / sizeof ( A [ 0 ] ) ; cout << KthMinValAfterMconcatenate ( A , N , M , K ) ; return 0 ; }