There are n different online courses numbered from 1 to n. You are given an array courses where courses[i] = [duration<sub>i</sub>, lastDay<sub>i</sub>] indicate that the i<sup>th</sup> course should be taken continuously for duration<sub>i</sub> days and must be finished before or on lastDay<sub>i</sub>.
You will start on the 1<sup>st</sup> day and you cannot take two or more courses simultaneously.
Return the maximum number of courses that you can take.
sum -= max; max = max - sum; if(sum <= 0 || max <= 0) returnfalse; intn=1; while(max > sum){ max -= n * sum; if(max <= 0){ max += n * sum; break; } n*=2; } sum += max; pq.offer(max); } } }
You’re given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels.
Letters are case sensitive, so "a" is considered a different type of stone from "A".