title: Minimum number of days required to solve a list of questions
body: <p>There are N problems numbered 1..N which you need to complete. You've arranged the problems in increasing difficulty order, and the ith problem has estimated difficulty level i. You have also assigned a rating vi to each problem. Problems with similar vi values are similar in nature. On each day, you will choose a subset of the problems and solve them. You've decided that each subsequent problem solved on the day should be tougher than the previous problem you solved on that day. Also, to not make it boring, consecutive problems you solve should differ in their vi rating by at least K. What is the least number of days in which you can solve all problems?</p>
  
  <p>Input:
  The first line contains the number of test cases T. T test cases follow. Each case contains an integer N and K on the first line, followed by integers v1,...,vn on the second line.</p>
  
  <p>Output:
  Output T lines, one for each test case, containing the minimum number of days in which all problems can be solved.</p>
  
  <p>Constraints:<br/>
  1 &lt;= T &lt;= 100<br/>
  1 &lt;= N &lt;= 300<br/>
  1 &lt;= vi &lt;= 1000<br/>
  1 &lt;= K &lt;= 1000<br/></p>
  
  <p>Sample Input:<br/>
  2<br/>
  3 2<br/>
  5 4 7<br/>
  5 1<br/>
  5 3 4 5 6<br/></p>
  
  <p>Sample Output:<br/>
  2<br/>
  1<br/></p>
  
  <p>This is one of the challenge from interviewstreet.<br/>
  Below is my approach<br>
  Start from 1st question and find out max possible number of question can be solve and remove these questions from the question list.Now again start from first element of the remainning list and do this till now size of the question list is 0.
  I am getting wrong answer from this method so looking for some algo to solve this challenge.  </p>