Alice and Bob take turns playing a game, with Alice starting first. You are given a string num of even length consisting of digits and ‘?’ characters. On each turn, a player will do the following if there is still at least one ‘?’ in num: The game ends when there are no more ‘?’…
Category: Miscellaneous
Leet code problem 1812: – Determine Color of a Chessboard Square
You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference. Flow Diagram: – Solution: –
Leet code problem 1800: – Maximum Ascending Subarray Sum
Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums. A subarray is defined as a contiguous sequence of numbers in an array. A subarray [numsl, numsl+1, …, numsr-1, numsr] is ascending if for all i where l <= i < r, numsi < numsi+1. Note that…
How to handle SSL certificate in Edge browser for Selenium Web-Driver?
In many cases we can face the error related to SSL certificate as mentioned below :- So, this error in Edge browser can be handled using EdgeOptions class provided by Selenium Web driver. The sample code block is mentioned below:- In the above code block we are accepting the Insecure certificate by passing Boolean value…
Leet code 1791: – Find Center of Star Graph
There is an undirected star graph consisting of n nodes labeled from 1 to n. A star graph is a graph where there is one center node and exactly n – 1 edges that connect the center node with every other node. You are given a 2D integer array edges where each edges[i] = [ui,…
How to copy or mirror code from one git repository to a new Git repository for Windows Machine
The steps are mentioned Below: Copy or clone the code to local folder from the Git repository: – For that first open the bash shell and move to the desires folder by using ‘cd’ command. And then type the below command and press enter. Here it is assumed that ‘ssh’ keygen is already generated and…
Leet code problem 1898: – Maximum Number of Removable Characters
You are given two strings s and p where p is a subsequence of s. You are also given a distinct 0-indexed integer array removable containing a subset of indices of s (s is also 0-indexed). You want to choose an integer k (0 <= k <= removable.length) such that, after removing k characters from…
Leet code problem 1423: – Maximum Points You Can Obtain from Cards
There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints. In one step, you can take one card from the beginning or from the end of the row. You have to take exactly k cards. Your score is the…
Leet code problem 1419: – Minimum Number of Frogs Croaking Medium
Given the string croakOfFrogs, which represents a combination of the string “croak” from different frogs, that is, multiple frogs can croak at the same time, so multiple “croak” are mixed. Return the minimum number of different frogs to finish all the croak in the given string. A valid “croak” means a frog is printing 5…
Leet code problem 1418: – Display Table of Food Orders in a Restaurant
Given the array orders, which represents the orders that customers have done in a restaurant. More specifically orders[i]=[customerNamei,tableNumberi,foodItemi] where customerNamei is the name of the customer, tableNumberi is the table customer sit at, and foodItemi is the item customer orders.Return the restaurant’s “display table”. The “display table” is a table whose row entries denote how…