1. Home
  2. >
  3. Easy way to iterate through testcase numbers
1

Easy way to iterate through testcase numbers
Aman Kumar Aman Kumar

Instead of using so long for loop, it can do the trick in less than 25% stroke. TIME is MONEY ;)

# coding shortcut# java# competitive coding# shorthand# loop tricks
class Solution {
      public static void main (String args[]){
        //iterating through testcases
        int T = 10;//storing testcase counter
        while(T-->0)//use T value to compare and then decrement it
        {
          //Perform bussiness logic here:
          System.out.println("T");
        }
      }
    }

Discussions

# coding shortcut# java# competitive coding# shorthand# loop tricks