Category: python
Reversing a List/Array is very commonly needed and there are three ways to reverse a list or array in Python. Using the .reverse() method to reverse a list or …
Given a 2D Grid with integer values representing the colours, you are asked (in an interview probably) to find out the maximum connected colour sizes. A colour is connected …
Implement a thread safe bounded blocking queue that has the following methods: BoundedBlockingQueue(int capacity) The constructor initializes the queue with a maximum capacity. void enqueue(int element) Adds an element …
How to Find the Index of Given Element in String/Tuple/List in Python? The index() in Python gives the lowest index that element matches the target. The index starts at …
A robot on an infinite grid starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands: -2: turn left 90 …