Dsa
Two Pointers
Warm-up
Find First Common Element
Given two sorted arrays, write a function to find the first common element present in both arrays. If no common element exists, return 'No Common Element'.
Input:
Two lines of space-separated integers representing the two arrays.
Output:
One integer or a message indicating no common elements.
Example:
Input:
1 2 3 4 5
2 3 6 7 8
Output:
2
Key concepts
two_pointersarrayset
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now