8 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....
9 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....
8 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....
10 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....
7 views
24 Jan 2026
You will receive q commands: PUSH x, POP, TOP. Create Stack class and for TOP output value or EMPTY....
7 views
24 Jan 2026
We have {x}. Create Item class with total() method. Output grand total cost....
7 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)....
7 views
24 Jan 2026
Given {x}, Create Employee class yearly() to return yearly salary with bonus included. Output as integer....
8 views
24 Jan 2026
You get {x}. Create Fraction class that reduces and supports add. Output result as p q reduced....
8 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....
8 views
24 Jan 2026
We have {x}. Create Player class and group by name summing scores. Output names sorted with total score....
9 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....
8 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....
8 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....
8 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....
7 views
24 Jan 2026
Given {x}, Create Polynomial class eval(x). Output value....
8 views
24 Jan 2026
You will receive q commands: PUSH x, POP, MIN. Create MinStack class and for MIN output current minimum or EMPTY....
7 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....
7 views
24 Jan 2026
We have {x}. Create Graph class with bfs(s,t) method. Output shortest distance or -1....
9 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....
7 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....
9 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....
9 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....
8 views
24 Jan 2026
You're given {x}. Create Trie class. For COUNT output how many added words have this prefix....
7 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)....
8 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....
8 views
24 Jan 2026
Simulate one bank account. Start balance = 0. Commands: DEPOSIT x, WITHDRAW x, FEE x. WITHDRAW fails if balance...
8 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....
9 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....
8 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....