function to find longest sub - array whose elements gives same remainder when divided with K
< ? php function LongestSubarray ( $ arr , $ n , $ k ) { $ cnt = 1 ; $ max_length = 1 ; $ prev_mod = $ arr [ 0 ] % $ k ;