A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom. Given a 0-indexed m x n matrix mat where no two adjacent cells are equal, find any peak element mat[i][j] and return the length 2 array [i,j]. You…
Month: November 2022
Demo Web Tables for Selenium Automation Practice
Demo Table 1 This table has 7 rows and 3 columns. So, the distribution of rows and columns even. We can assume this table as static table. Company Name Contact Country Google Maria Andreas France Microsoft Roland Mendel UK Island Trading Yoshi Tannamuri Canada Amazon Giovanni Rovelli Italy Meta Giovanni Rovelli Italy Google Francisco Chang…
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 1422: – Maximum Score After Splitting a String
Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring). The score after splitting a string is the number of zeros in the left substring plus the number of ones in the right substring. Example 1: Input: s =…
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…
Leet code 1417: – Reformat the String
Given alphanumeric string s. (Alphanumeric string is a string consisting of lowercase English letters and digits). You have to find a permutation of the string where no letter is followed by another letter and no digit is followed by another digit. That is, no two adjacent characters have the same type. Return the reformatted string…
Leet code problem 1415: – The k-th Lexicographical String of All Happy Strings of Length n Medium
A happy string is a string that: For example, strings “abc”, “ac”, “b” and “abcbabcbcb” are all happy strings and strings “aa”, “baa” and “ababbc” are not happy strings. Given two integers n and k, consider a list of all happy strings of length n sorted in lexicographical order.Return the kth string of this list…