title: Delete the first half elements from stack of integer
body: <p>You are given a stack with n integers. You need to delete floor(n/2) elements from the bottom of the stack and print the remaining elements of the stack. The remaining elements should be printed in the order that they are inserted into the stack.</p>
  <p>floor(3.5) will give the output as 3, greatest integer less than or equal to the input.
  Input Format:
  The first line of input is an integer n denoting the size of stack. The next line contains n space separated integers.
  Output Format:
  The remaining elements of the stack after removal of the required elements.
  Example:
  Stack(bottom -&gt; top) = [1, 2, 3, 4, 5, 6]
  Output: [4, 5, 6]</p>
  <p>Stack = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
  Output: [6, 7, 8, 9, 10, 11]</p>
  <p>Sample Input:
  12
  1 2 3 4 5 6 7 8 9 10 11 12</p>
  <p>Sample Output:
  [7, 8, 9, 10, 11, 12]</p>
  <p>Sample input:
  19
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19</p>
  <p>Sample Output:
  [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]</p>
  <p>Here my problem is my code passed test case 1 and test case 2 but in test case 3 where sample input is 19 there is should be printing as mentioned above output but my output came [11, 12, 13, 14, 15, 16, 17, 18, 19] its omitting 10th element and i dont know where is my error. So please help me in this</p>
  <p>MY Code  -</p>
  <pre><code>import java.util.*;
  
  public class DeleteElement {
      public static void main(String args[]) {
          Stack&lt;Integer&gt; stack = new Stack&lt;&gt;();
          Scanner s = new Scanner(System.in);
          int n = s.nextInt();
          while (n-- &gt; 0)
              stack.push(s.nextInt());
          deleteFirstHalf(stack, stack.size(), 0);
          System.out.println(stack);
      }
  
      static void deleteFirstHalf(Stack&lt;Integer&gt; stack, int n, int curr) {
  
  
          if(stack.empty() || curr == n) {
              return;
          }
          int x = stack.pop();
  
          deleteFirstHalf(stack, n, curr+1);
  
          if(curr&lt;Math.floor(n/2)){
              stack.push(x);
          }
      }
  }
  </code></pre>
  <p><strong>Note - Don't change the main() in my code.</strong></p>