9 views
24 Jan 2026
You have a bank account with starting balance B. Then q commands: DEP x, WIT x (withdraw, but if not enough keep same). Output final balance....
11 views
24 Jan 2026
You have q commands: INC, DEC. Create Counter class. DEC cannot go below 0. Output final value....
9 views
24 Jan 2026
You get {x}. Create Student class with method avg(). Output average with 2 decimals....
9 views
24 Jan 2026
You're given {x}. Create Point class with method dist0() giving distance from origin. Output with 3 decimals....
8 views
24 Jan 2026
Title (no spaces) and pages are provided. Create Book class with method thick() that returns YES if pages>300 else NO....
8 views
24 Jan 2026
Celsius value is provided. Create Temperature class with method to_f(). Output Fahrenheit with 2 decimals....
11 views
24 Jan 2026
Distance d, mileage m (km per litre) and fuel f are provided. Create Car class can_reach(d) returns YES if fuel enough else NO....
8 views
24 Jan 2026
You will receive q commands: PUSH x, POP, TOP. Create Stack class and for TOP output value or EMPTY....
9 views
24 Jan 2026
We have {x}. Create Item class with total() method. Output grand total cost....
8 views
24 Jan 2026
Input provides {x}. Create Circle class with area() and sort circles by area ascending. Output sorted radii....
9 views
24 Jan 2026
Time hh mm ss and extra seconds x are provided. Create Time class add(x) and output new time in HH:MM:SS (24h)....
8 views
24 Jan 2026
Given {x}, Create Employee class yearly() to return yearly salary with bonus included. Output as integer....
10 views
24 Jan 2026
You get {x}. Create Fraction class that reduces and supports add. Output result as p q reduced....
9 views
24 Jan 2026
Given {x}, Create Matrix class with add method. Output resulting matrix....
8 views
24 Jan 2026
You will receive q commands: ADD name, DONE name, COUNT. Create TaskTracker class. COUNT prints how many tasks are pending....
10 views
24 Jan 2026
We have {x}. Create Player class and group by name summing scores. Output names sorted with total score....
10 views
24 Jan 2026
You will receive q commands: ADD item price, REMOVE item, TOTAL. Create Cart class. TOTAL prints sum of prices of current items....
9 views
24 Jan 2026
You will receive q commands: ENQ x, DEQ, FRONT. Create Queue class using two stacks. FRONT prints front value or EMPTY....
9 views
24 Jan 2026
One URL string like domain/path is provided (no spaces). Create URL class with domain() and path() methods. If no '/', path is EMPTY....
10 views
24 Jan 2026
You're given {x}. Create Validator class ok() that checks: length>=8, has at least one digit, one uppercase, one lowercase. Output YES or NO....
9 views
24 Jan 2026
Given {x}, Create Polynomial class eval(x). Output value....
9 views
24 Jan 2026
You will receive q commands: PUSH x, POP, MIN. Create MinStack class and for MIN output current minimum or EMPTY....
8 views
24 Jan 2026
Cache capacity cap is provided and q commands: PUT k v, GET k. Implement LRUCache class. For GET output value or -1....
8 views
24 Jan 2026
We have {x}. Create Graph class with bfs(s,t) method. Output shortest distance or -1....
11 views
24 Jan 2026
You're given {x}. Create Calendar class add(start,end) returns YES if added else NO (conflict if overlap). Output results for each add....
9 views
24 Jan 2026
You will receive q commands: SET path value, GET path. Path is dot separated. Create Store class to handle. For GET output value or NOT FOUND....
11 views
24 Jan 2026
Two sparse vectors are provided as list of index:value pairs. Build SparseVector class with dot(other). Output dot product....
7 views
24 Jan 2026
Consider {x}. Create Complex class with add and mul. Output sum then product as 'x y' for real and imag....
8 views
24 Jan 2026
You get {x}. Create Email class that normalizes (lowercase, trim spaces). Output count of unique normalized emails....
10 views
24 Jan 2026
Input provides {x}. Make DSU class with find and union. Queries: UNION u v, ASK u v. For ASK output YES if connected else NO....
10 views
24 Jan 2026
You're given {x}. Create Trie class. For COUNT output how many added words have this prefix....
8 views
24 Jan 2026
You will receive q commands: ADD x or MEDIAN. Create MedianFinder class using two heaps. For MEDIAN output lower median (floor for even count)....
10 views
24 Jan 2026
You get {x}. Build SegmentTree class with update(i,x) and query(l,r) returning minimum. Output query answers....
8 views
24 Jan 2026
Maintain a student register. Process q commands: ADD id name, DEL id, GET id, COUNT. Print output for each GET and COUNT....
9 views
24 Jan 2026
Simulate one bank account. Start balance = 0. Commands: DEPOSIT x, WITHDRAW x, FEE x. WITHDRAW fails if balance...
9 views
24 Jan 2026
You will get q shapes. Each line: RECT w h, CIRC r, or SQR a. Print total area with 2 decimals....
9 views
24 Jan 2026
Implement an LRU cache of capacity C. You will get q operations: GET key and PUT key value. For each GET print value or -1....
11 views
24 Jan 2026
Commands: SUB user topic, UNSUB user topic, PUB topic msg(no spaces). For each PUB print how many users receive the message....
6 views
24 Jan 2026
Tables: Orders(order_id, customer_id, total_amount, created_at). Return customer_id and total spend, sorted by spend desc....
8 views
24 Jan 2026
Table: Employees(emp_id, name, manager_id). Find employees who have no manager....
5 views
24 Jan 2026
Table: Employees(emp_id, salary). Return the second highest distinct salary. If it does not exist, return NULL....
9 views
24 Jan 2026
Table: Logins(user_id, login_time). Return date and number of distinct users per date....
6 views
24 Jan 2026
Tables: Orders(order_id, customer_id), Customers(customer_id). List orders whose customer_id does not exist in Customers....
5 views
24 Jan 2026
Tables: Products(product_id, name), OrderItems(order_id, product_id). Find products that never appear in OrderItems....
5 views
24 Jan 2026
Table: Employees(emp_id, salary). Write a query pattern to get the Nth highest distinct salary (assume N is given)....
8 views
24 Jan 2026
Table: Logins(user_id, day). day is a date. Find users who logged in on 3 consecutive days....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
5 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
5 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
4 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
4 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
5 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
6 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
4 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
8 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
6 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
4 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
11 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
4 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
4 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
4 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
4 views
24 Jan 2026
Table: Sales(store_id, amount). Return store_id and average amount, only stores with at least 5 rows....
5 views
24 Jan 2026
Table: Scores(user_id, score, created_at). Return each row with the rank of score within the same day....
6 views
24 Jan 2026
Tables: A(id, val), B(id, val). Return ids present in both tables....
8 views
24 Jan 2026
Explain the practical difference between TCP and UDP, and give one real use-case for each....
8 views
24 Jan 2026
Walk through a typical TLS handshake at a high level....
4 views
24 Jan 2026
What is NAT and why is it commonly used in home networks?...
4 views
24 Jan 2026
Describe the TCP three-way handshake....
5 views
24 Jan 2026
In simple terms, what is TCP slow start?...
5 views
24 Jan 2026
What is a health check and why do load balancers need it?...
8 views
24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...
6 views
24 Jan 2026
How does a CDN reduce latency?...
4 views
24 Jan 2026
When would you choose WebSockets over plain HTTP?...
5 views
24 Jan 2026
How does packet loss typically show up for users?...
5 views
24 Jan 2026
Explain DNS caching and one common issue it can cause....
7 views
24 Jan 2026
Why do HTTP connections often use keep-alive?...
4 views
24 Jan 2026
What does /24 mean in CIDR notation?...
5 views
24 Jan 2026
Describe the TCP three-way handshake....
5 views
24 Jan 2026
In simple terms, what is TCP slow start?...
4 views
24 Jan 2026
What is a health check and why do load balancers need it?...
5 views
24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...
5 views
24 Jan 2026
How does a CDN reduce latency?...
4 views
24 Jan 2026
When would you choose WebSockets over plain HTTP?...
4 views
24 Jan 2026
How does packet loss typically show up for users?...
6 views
24 Jan 2026
Explain DNS caching and one common issue it can cause....
5 views
24 Jan 2026
Why do HTTP connections often use keep-alive?...
5 views
24 Jan 2026
What does /24 mean in CIDR notation?...
7 views
24 Jan 2026
Describe the TCP three-way handshake....
8 views
24 Jan 2026
In simple terms, what is TCP slow start?...
6 views
24 Jan 2026
What is a health check and why do load balancers need it?...
5 views
24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...
6 views
24 Jan 2026
How does a CDN reduce latency?...
4 views
24 Jan 2026
When would you choose WebSockets over plain HTTP?...
5 views
24 Jan 2026
How does packet loss typically show up for users?...
3 views
24 Jan 2026
Explain DNS caching and one common issue it can cause....
8 views
24 Jan 2026
Why do HTTP connections often use keep-alive?...
6 views
24 Jan 2026
What does /24 mean in CIDR notation?...
2 views
24 Jan 2026
Describe the TCP three-way handshake....
6 views
24 Jan 2026
In simple terms, what is TCP slow start?...
4 views
24 Jan 2026
What is a health check and why do load balancers need it?...
6 views
24 Jan 2026
Which HTTP methods are idempotent and why does it matter?...
3 views
24 Jan 2026
How does a CDN reduce latency?...
4 views
24 Jan 2026
When would you choose WebSockets over plain HTTP?...
4 views
24 Jan 2026
How does packet loss typically show up for users?...
4 views
24 Jan 2026
Design a URL shortener like bit.ly. Focus on APIs, storage, and scaling....
4 views
24 Jan 2026
Design a rate limiter for an API gateway....
4 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
5 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
3 views
24 Jan 2026
Upload, download, and share large files....
5 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
3 views
24 Jan 2026
Centralize logs from many services and make them searchable....
3 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
3 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
4 views
24 Jan 2026
Upload, download, and share large files....
5 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
5 views
24 Jan 2026
Centralize logs from many services and make them searchable....
4 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
6 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
5 views
24 Jan 2026
Upload, download, and share large files....
5 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
4 views
24 Jan 2026
Centralize logs from many services and make them searchable....
5 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
5 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
5 views
24 Jan 2026
Upload, download, and share large files....
6 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
3 views
24 Jan 2026
Centralize logs from many services and make them searchable....
3 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
3 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
4 views
24 Jan 2026
Upload, download, and share large files....
4 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
4 views
24 Jan 2026
Centralize logs from many services and make them searchable....
4 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
4 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
4 views
24 Jan 2026
Upload, download, and share large files....
5 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
3 views
24 Jan 2026
Centralize logs from many services and make them searchable....
3 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
4 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
4 views
24 Jan 2026
Upload, download, and share large files....
3 views
24 Jan 2026
Push notifications for mobile/web. What are the main components?...
5 views
24 Jan 2026
Centralize logs from many services and make them searchable....
3 views
24 Jan 2026
1:1 chat with typing indicator and read receipts....
4 views
24 Jan 2026
Home feed like Twitter: rank posts and serve fast....
3 views
24 Jan 2026
Upload, download, and share large files....
6 views
24 Jan 2026
Input provides {x}. Implement bfs to output shortest distance (edges count) or -1....
5 views
24 Jan 2026
Input provides {x}. Create Graph class with bfs(s,t) method. Output shortest distance or -1....
6 views
24 Jan 2026
You get {x}. Token types: INT, FLOAT (with dot), WORD. Sort by type order INT then FLOAT then WORD. For ints sort by numeric value, for floats sort by numeric value, for words sort lexicographically. ...
6 views
24 Jan 2026
We have {x}. Create Trie class. For COUNT output how many added words have this prefix....
6 views
24 Jan 2026
For each testcase you get weighted undirected graph. Output shortest distance from 1 to n. If unreachable output -1....
5 views
24 Jan 2026
You will receive q commands: ADD x or MEDIAN. Create MedianFinder class using two heaps. For MEDIAN output lower median (floor for even count)....
4 views
24 Jan 2026
For each testcase you get n, k and n integers. For each window of size k output how many distinct numbers are inside....
6 views
24 Jan 2026
We have {x}. If never repeats, output -1....
5 views
24 Jan 2026
Input provides {x}. Write function merge(intervals) and output merged intervals sorted....
5 views
24 Jan 2026
Given {x}, Two types: 1 i x means set a[i]=x, 2 l r means output sum of a[l..r] (1-based). Implement build/update/query helpers....
5 views
24 Jan 2026
You're given {x}. For each window output maximum. Use a deque....
5 views
24 Jan 2026
You get {x}. Compute the minimum length of a contiguous subarray with sum >= S. If not found, output 0....
6 views
24 Jan 2026
For each testcase you get a tree with n nodes. Output the diameter length (number of edges on longest path)....
6 views
24 Jan 2026
Consider {x}. Output result....
6 views
24 Jan 2026
Given {x}, Output their longest common prefix. If no common prefix, output EMPTY....
5 views
24 Jan 2026
For each testcase you get n numbers. Compute length of the longest prefix that is strictly increasing....
6 views
24 Jan 2026
For each testcase you get n, k and n numbers. Output max of each window of size k (space-separated)....
7 views
24 Jan 2026
For each testcase you get n integers. Sort them by frequency descending. If frequency same, smaller number first. Output sorted list....
18 views
24 Jan 2026
Consider {x}. Use recursion function dfs(i,cur) to generate all subset sums. Output sums sorted....
6 views
24 Jan 2026
We have {x}....
4 views
24 Jan 2026
You have n bulbs all OFF. For i from 1 to n, toggle every i-th bulb. At the end, how many bulbs are ON? Output count....
5 views
24 Jan 2026
Input provides {x}. Compute length of the longest contiguous subarray that has at most K distinct numbers....
7 views
24 Jan 2026
You're given {x}. Compute maximum subarray sum in circular array and output it....
5 views
24 Jan 2026
Given {x}, Output prefix sum after each element (same order)....
7 views
24 Jan 2026
Consider {x}. Build SegmentTree class with update(i,x) and query(l,r) returning minimum. Output query answers....
6 views
24 Jan 2026
Input provides {x}. Implement to build prefix hashes and answer hash values mod 1000000007....
5 views
24 Jan 2026
We have {x}. Each token can be decimal like 15, binary like 0b1010, octal like 0o12, or hex like 0xFF. Tokens can also have a leading '-' sign. Convert all to integer and output the sum....
6 views
24 Jan 2026
For each testcase you get a directed graph. If topological order exists, output one order. If cycle exists, output CYCLE....
4 views
24 Jan 2026
Two binary strings a and b are provided (same length). Compute bitwise XOR and output result without leading zeros (output 0 if all zero)....
5 views
24 Jan 2026
One non-negative integer n is provided. Count how many 1 bits are in binary representation and output it....
6 views
24 Jan 2026
You get {x}. Output its binary without using bin(). Use repeated division and variables....
6 views
24 Jan 2026
You're given {x}. Output 1 if k-th bit (0-based) of n is set, else 0....
6 views
24 Jan 2026
For each testcase you get n, k and n integers. Output the k-th largest element....
6 views
24 Jan 2026
You're given {x}. Compute kth smallest element using quickselect style and output it....
6 views
24 Jan 2026
Consider {x}. For each word, count all its prefixes. Then q prefixes are provided. For each prefix output how many words start with it....
4 views
24 Jan 2026
Consider {x}. Write function build_prefix(arr) and answer sums fast....
5 views
24 Jan 2026
We have {x}. Sort them by frequency ascending, if tie by value ascending. Output sorted list....
6 views
24 Jan 2026
Consider {x}. Create Circle class with area() and sort circles by area ascending. Output sorted radii....
6 views
24 Jan 2026
Consider {x}. Output YES if there exists a subarray with sum exactly S else NO....
4 views
24 Jan 2026
Consider {x}. Add them without using + or -. Use bit operations and output sum....
6 views
24 Jan 2026
A string s and integer k are provided. Rotate string to the right by k positions and output....
5 views
24 Jan 2026
For each testcase you get string s and integer k. Rotate string to the right by k and output the new string....
6 views
24 Jan 2026
A boolean string s of 0/1 and a boolean string t of 0/1 are provided, same length. Treat them as bits and compute (s XOR t) as a new string. Output it....
6 views
24 Jan 2026
A string is provided in form like 3[a2[c]] where number means repeat. Decode and output the final string....
6 views
24 Jan 2026
A number is provided as string. It may have + sign, leading zeros, and decimal part. Normalize it: remove +, remove extra leading zeros, remove trailing zeros in decimal, and if it becomes -0 or 0.0 t...
7 views
24 Jan 2026
Input provides {x}. Remove every occurrence of p from s while scanning left to right (like stack remove). Output final string....
6 views
24 Jan 2026
Input is a single string s is provided (no trailing spaces needed). Output the reversed string....
4 views
24 Jan 2026
You're given {x}. Compute rolling hash: h=0; for each char c: h=(h*B+ord(c))%M. Output h....
6 views
24 Jan 2026
You're given {x}. Split array into m non-empty continuous parts to minimize the maximum part sum. Output that minimum possible value....
5 views
24 Jan 2026
Input is a single string s is provided (can contain spaces). Output its length, first character and last character. If string is empty, output 0 - -....
5 views
24 Jan 2026
A quoted string is provided. It can contain escapes: \\\\n, \\\\t, \\\\\\\\, and \\\\\. Unescape it and output two integers: length and checksum (sum of char codes modulo 256)."....
6 views
24 Jan 2026
You get {x}. Output YES if pattern matches whole string else NO....
4 views
24 Jan 2026
Consider {x}. Each testcase has n and array. Output YES if array is non-decreasing else NO....
7 views
24 Jan 2026
For each testcase you get string s. Repeatedly remove adjacent equal characters using a stack idea. Output final string (or EMPTY)....
6 views
24 Jan 2026
A string s is provided. Remove all digits (0-9) and output remaining string....
6 views
24 Jan 2026
You're given {x}. Build reverse mapping: for each value, how many keys map to it. Output values sorted with their counts....
5 views
24 Jan 2026
Input provides {x}. Rotate list to the right by k positions and output....
6 views
24 Jan 2026
An encoded string is provided like a3b2c (letters with optional number). Decode and output the original string....
6 views
24 Jan 2026
A string s is provided. Compress it using run-length encoding as: char followed by count (only when count>1). Output encoded string....
5 views
24 Jan 2026
A string s is provided (maybe with leading spaces and sign). Parse first integer like simple atoi. If no number, output 0....
4 views
24 Jan 2026
Consider {x}. Make DSU class with find and union. Queries: UNION u v, ASK u v. For ASK output YES if connected else NO....
5 views
24 Jan 2026
You will receive q commands: PUSHFRONT x, PUSHBACK x, POPFRONT, POPBACK. Start empty. On POP when empty, output ERROR and stop. Else after all commands output final deque as space-separated or EMPTY....
7 views
24 Jan 2026
You will receive n statements in a tiny language: 'set x v' or 'add x y' meaning x = x + y. If add uses a variable that was never set before (for x or y), count it as a bad read. Output badReadCount....
6 views
24 Jan 2026
You will receive q queries like GET name or SET name value. Maintain variables in a dict. For each GET, output value if present else UNSET....
6 views
24 Jan 2026
Integers a and m are provided, and exponent b is provided as a very large decimal string. Output (a^b) % m....
7 views
24 Jan 2026
A JSON array is provided in one line, like [1,2,true,null]. Count how many numbers, strings, booleans, and null values. Output counts in order: num str bool null....
6 views
24 Jan 2026
A string s is provided (no spaces). Compute length of longest palindromic substring. Use linear-time method....
5 views
24 Jan 2026
We have {x}. Make final score for each key as sum of scores from both lists (missing is 0). Output keys sorted with their final score....
7 views
24 Jan 2026
A string s is provided (no spaces). Compute minimum insertions needed to make it a palindrome. Output the number....
5 views
24 Jan 2026
You will receive q commands on a nested dictionary: SET path value, GET path. Path is dot separated like a.b.c. For GET output value if exists else NOT FOUND....
6 views
24 Jan 2026
Given {x}, .255). Put them into a bytes object and output hex string in uppercase....
8 views
24 Jan 2026
For each testcase you get n and q updates. Each update adds val to all positions l..r (1-based). After all updates output final array....
6 views
24 Jan 2026
A string s is provided. Remove all space characters and output the new string....
7 views
24 Jan 2026
Input provides {x}. Example aaabb becomes a3b2. Output compressed string....
10 views
24 Jan 2026
A string s is provided. Consider all rotations of s. Output the lexicographically smallest rotation....
7 views
24 Jan 2026
A string s and integer k are provided. Pick a subsequence of length k (keep order) with smallest lexicographic value. Output that subsequence....
6 views
24 Jan 2026
You get {x}. Compute the length of smallest substring of s that contains all characters of p with at least same counts. If not possible output 0....
6 views
24 Jan 2026
Input provides {x}. Start empty list. POP on empty does nothing. At end output size and last element (or EMPTY)....
5 views
24 Jan 2026
A number is provided as a string x and an integer y is provided. Convert x to int and output x+y....
5 views
24 Jan 2026
You're given {x}. Then two keys k1 and k2 are provided. If both keys exist, swap their values. Finally output value of k1 and value of k2 (use NA if a key does not exist)....
9 views
24 Jan 2026
Name and age are provided. Create class Person with method greet() that returns 'Hi , you are '. Output greet()....
8 views
24 Jan 2026
Length and width are provided. Create Rectangle class with area() method. Output area as integer....