Add solution for K difference problem