Sasken's coding round is one of the toughest parts of its selection process — one hands-on coding question in 60 minutes, decent enough marks riding on it. These questions are reconstructed from real student feedback after their Sasken assessments.

A note on accuracy: The original feedback we collected was fragmented, inconsistently worded, and in a few cases missing key details (exact rules, full sample data). Each question below has been reformatted into the standard assessment pattern (Problem Statement → Input Format → Output Format → Sample Input/Output → Explanation). Where the underlying logic could be reliably confirmed from the given sample, it's presented with full confidence. Where the feedback was too vague to reconstruct exactly, this is clearly flagged, along with the most plausible interpretation and similar problems to practice instead.

Question 1: Count Right-Angled Triangles in a Binary Matrix

Confirmed logic — appeared in two separate feedback entries

Problem Statement: Given a binary matrix (containing only 0s and 1s), count the total number of right-angled triangles that can be formed using the 1s in the matrix. A right-angled triangle is formed by three cells containing 1, where one cell acts as the right-angle corner, with one other 1 somewhere else in its row and one other 1 somewhere else in its column.

Input Format: First line: number of rows R and columns C. Next R lines: C space-separated values (0 or 1) representing the matrix.

Output Format: A single integer — the total count of right-angled triangles.

Constraints: 1 ≤ R, C ≤ 100 (typical range; not explicitly confirmed)

Sample Input 1:
3 4
1 0 1 0
1 0 0 0
1 0 0 0

Sample Output 1: 2
Sample Input 2 (dimensions only, matrix not remembered):
4 4

Sample Output 2: 4

Explanation: For every cell (i, j) containing 1, it can act as the right-angle vertex for (count of 1s in row i − 1) × (count of 1s in column j − 1) triangles. Summing this over all 1-cells gives the answer. For Sample 1: Row 0 has two 1s (cols 0, 2), Column 0 has three 1s (rows 0,1,2). Only cell (0,0) contributes: (2−1) × (3−1) = 1 × 2 = 2. All other 1-cells contribute 0, giving a total of 2.

One student recalled this as "inverted" right-angle triangles — likely just referring to the orientation of the right-angle vertex (top-left vs. bottom-right). The core row/column counting logic is the same either way.

Question 2: Closest Greater Subsequence Number

Problem Statement: Given two numbers, generate all possible numbers formed by subsequences of the digits of the first number (maintaining their original order). Among all these subsequence-numbers, find the one that is closest to the second number but strictly greater than it.

Input Format: Two integers — num1 (source of digits) and num2 (target to exceed).

Output Format: The closest subsequence-number greater than num2. Print -1 if none exists.

The sample recalled by the student (num1=2, num2=-1011,1001 → Output: {5,3}) doesn't cleanly fit the described logic — it may involve multiple test cases bundled together or a transcription error. Treat that specific sample with caution.

Illustrative example (reconstructed for clarity):

Input: num1 = 1234, num2 = 20
Output: 23

Explanation: Subsequences of 1234 (order preserved): 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234... The smallest one greater than 20 is 23.

Practice tip: This is fundamentally a subsequence-generation + closest-value-search problem. Practice generating subsequences via recursion/bitmasking, then use sorting or a min-comparison scan to find the closest value greater than a target.

Question 3: Digit-Sum Augmented Value ("Augmented Value")

Problem Statement: Given a number, compute its "augmented value" by adding ten times the sum of its digits to the original number.

Input Format: A single integer N.

Output Format: The computed augmented value.

Sample Input: 421
Sample Output: 491

Explanation: Sum of digits of 421 = 4+2+1 = 7. Augmented value = 421 + (7 × 10) = 421 + 70 = 491. ✅ Matches the sample.

Reconstructed from a single data point — the actual rule in the real question may differ slightly (e.g. a different multiplier), so verify if you can find a second example.