Intro to Tutorial Challenges HackerRank Solution


Intro to Tutorial Challenges HackerRank Solution
Source : https://www.hackerrank.com/challenges/tutorial-intro



Source : https://www.hackerrank.com/challenges/tutorial-intro


Solution


// Karthikalapati.blogspot.com
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int V = scan.nextInt();
int n = scan.nextInt();
for (int i = 0; i < n; i++) {
if (scan.nextInt() == V) {
System.out.println(i);
break;
}
}
scan.close();
}
}

No comments:

Post a Comment