All Tracks Algorithms Searching Linear Search Problem

Simple Search
Tag(s):

Easy

Problem
Editorial
Analytics

Given a List of Distinct N number a1,a2,a3........an.
Find The Position Of Number K In The Given List.

Input Format

First Line Take Input Value Of N

Second Line Take Input N Space Separated Integer Value

Third Line Take Input Value Of K

Output Format

Position Of K In The Given List

Constraints

  • 0 < N < 100001
  • 0 < ai < 1010
  • 0 < K < 1010

NOTE:
Array Indexing Starts From 0

SAMPLE INPUT
5
1 2 3 4 5
4
SAMPLE OUTPUT
3
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications

?