๐ Exclusive Offer! Join our Telegram Channel to get **special discounts** and updates! ๐
Question 2
Implement a Least Frequently Used (LFU) cache data structure of size cacheSize that handles two types of queries: GET and PUT.
A GET query attempts to retrieve the value of a given key.
If the key is present in the cache, it is returned.
Otherwise, it returns -1.
A PUT query updates or inserts a key-value pair into the cache.
When the cache is full, the least frequentl
Asked in: ShareChat
People Bought: 0
Price (in Rs): 151.00
A forklift operator navigates products within an automotive parts warehouse. The dashboard displays a real-time map showing open and blocked sections as an n x m matrix of 1's (open) and 0's (blocked). The operator starts at the top-left corner of the map at warehouse[0][0] and aims to reach the bottom-right corner at warehouse[n-1][m-1].
Movements can only be made to the right or downward. Giv
Asked in: ShareChat
People Bought: 0
Price (in Rs): 201.00
1. Question 1
Given a chessboard of n rows (top to bottom) and n columns (left to right). In each move, a knight moves either:
2 column positions and 1 row position
2 row positions and 1 column position
In other words, a move is 2 steps along one axis and 1 step along a perpendicular axis.
Given a starting position A and ending position B, calculate the minimum number of moves needed by the k
Asked in: ShareChat
People Bought: 0
Price (in Rs): 151.00
Efficient Network
There are n computer systems connected together to form a network. The network can be represented as a rooted tree (rooted at master computer 1), where the connections are described using two arrays connect_from[]and connect_to[]. Each pair (connect_from[i], connect_to[i]) denotes an undirected edge between the two computers. Additionally, each computer has a value assigned to i
Asked in: ShareChat
People Bought: 0
Price (in Rs): 251.00
Subsequence Sort
Given a binary string binary consisting of characters '0' and '1' only, perform the following 0
or more times.
ยท Choose any subsequence, sort the subsequence, and replace the original subsequence with the sorted sequence.
Next, there is an array of strings, arr, of length n, where each string has length / binary/ and consists of characters '0', '1' and '?'. Each '?' characte
Asked in: ShareChat
People Bought: 0
Price (in Rs): 250.00
Break The Bricks
There are n bricks arranged in a row at positions numbered from 1 through n, inclusive. There is an array, newtons[n], that contains an integer indicating the number of newtons required to
smash a brick., (A newton is a unit of force.)
There are two hammers, one big and one small. The big hammer can smash any brick with one blow. The small hammer reduces the newtons require
Asked in: ShareChat
People Bought: 0
Price (in Rs): 200.00