You are given an array of ranges int[][] ranges where each range is [l, r] (inclusive).
Find how many distinct prime numbers appear in at least one of these ranges.
If a prime appears in multiple ranges, count it only once
Ranges can overlap
Return the total count.
You have unlimited apples.
You can perform this operation:
Exchange 1 apple → B oranges
You want to end up with exactly A total fruits (apples + oranges).
Return the number of ways to do this.
No restriction on starting apples
You are given a directed graph with N nodes and edges.
Some edges form cycles. If a car enters such a cycle, it gets stuck.
You can reverse the direction of any edge.
Find the number of ways to assign directions to edges such that no cycles remain.
Two ways are different if at least one edge direction differs
Return answer modulo 10^9+7
There was one more question which I can’t recall completely, but it was based on permutations from 1 to |A|.
According to me, it wasn’t too hard, just a combination of 2–3 standard topics.