p23_5
Maintain an array p\np[h]=index of (h+1 th 1) from nums\nUse a window of  k, 1\'s and try to to bring them together\nThis window will be of size k in the p arra
Maintain an array p\np[h]=index of (h+1 th 1) from nums\nUse a window of  k, 1\'s and try to to bring them together\nThis window will be of size k in the p array as it contains only 1\'s\nMedian is the optimal place to bring all ones togather in a window\n
[]