Answers for "InfyTQ coding questions list"

0

infytq questions

public class Tester {
    public static void main (String [ ] args) {
            int [ ] tempList = { 1, -1, -2 } ;
            int [ ] numList = {-2, -1, 1 } ;
            int length = numList.length ;
            for (int value : tempList) {
                  int tempValue = value ;
                  if (value<0) {
                         tempValue = length - Maths.abs(value) ;
                  }
                  if(value == tempList [tempValue]) {
                        if(value<0) {
                               numList [length-tempValue]=value ;
                         
                            }
                        else {
                               numList [tempValue]=value ;
                         }
                    }
                    else {
                          numList [0] = value ;
                     }
             }
      }
}
Posted by: Guest on April-01-2021

Code answers related to "InfyTQ coding questions list"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language