LearnPy Hub
← Comprehensions problems
Medium

Count Ordered Pairs

Read two lists. Count the pairs (x, y) with x from the first list, y from the second and x < y, using a nested comprehension inside sum() or len().

Input

Two lines.

Output

One integer.

Sample 1

Input
1 2 3
2 3 4
Output
6

Sample 2

Input
5
1
Output
0
solution.py
Output appears here
Count Ordered Pairs · Python practice problem · LearnPy Hub